Code Modernization: Rename parameters that use reserved keywords in `wp-includes/block-supports/border.php`.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names. This commit renames the `$default` parameter to `$default_value` in `wp_has_border_feature_support()`. Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. Built from https://develop.svn.wordpress.org/trunk@53240 git-svn-id: http://core.svn.wordpress.org/trunk@52829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88b6ade46a
commit
01a28c0031
|
@ -155,21 +155,21 @@ function wp_apply_border_support( $block_type, $block_attributes ) {
|
|||
*
|
||||
* @param WP_Block_Type $block_type Block type to check for support.
|
||||
* @param string $feature Name of the feature to check support for.
|
||||
* @param mixed $default Fallback value for feature support, defaults to false.
|
||||
* @param mixed $default_value Fallback value for feature support, defaults to false.
|
||||
* @return bool Whether the feature is supported.
|
||||
*/
|
||||
function wp_has_border_feature_support( $block_type, $feature, $default = false ) {
|
||||
function wp_has_border_feature_support( $block_type, $feature, $default_value = false ) {
|
||||
// Check if all border support features have been opted into via `"__experimentalBorder": true`.
|
||||
if (
|
||||
property_exists( $block_type, 'supports' ) &&
|
||||
( true === _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), $default ) )
|
||||
( true === _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), $default_value ) )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the specific feature has been opted into individually
|
||||
// via nested flag under `__experimentalBorder`.
|
||||
return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default );
|
||||
return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default_value );
|
||||
}
|
||||
|
||||
// Register the block support.
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-beta2-53239';
|
||||
$wp_version = '6.0-beta2-53240';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue