From 89f24e9c61e3905bf58ac1b848b99f9a9ed5ac34 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Apr 2022 14:24:12 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in bundled themes. 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 `$class` parameter to `$css_class` in: * `twentysixteen_excerpt()` * `twentynineteen_post_classes()` * Renames the `$echo` parameter to `$display` in: * `twentythirteen_entry_date()` * `twentytwenty_generate_css()` * `twentytwenty_site_logo()` * `twentytwenty_site_description()` * `twenty_twenty_one_generate_css()` 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]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. Built from https://develop.svn.wordpress.org/trunk@53236 git-svn-id: http://core.svn.wordpress.org/trunk@52825 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../twentynineteen/inc/template-functions.php | 2 +- .../themes/twentysixteen/inc/template-tags.php | 10 +++++----- wp-content/themes/twentythirteen/functions.php | 6 +++--- wp-content/themes/twentytwenty/inc/custom-css.php | 6 +++--- .../themes/twentytwenty/inc/template-tags.php | 14 +++++++------- .../themes/twentytwentyone/inc/custom-css.php | 6 +++--- wp-includes/version.php | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/wp-content/themes/twentynineteen/inc/template-functions.php b/wp-content/themes/twentynineteen/inc/template-functions.php index 301ac23116..6c5a96714e 100644 --- a/wp-content/themes/twentynineteen/inc/template-functions.php +++ b/wp-content/themes/twentynineteen/inc/template-functions.php @@ -35,7 +35,7 @@ add_filter( 'body_class', 'twentynineteen_body_classes' ); /** * Adds custom class to the array of posts classes. */ -function twentynineteen_post_classes( $classes, $class, $post_id ) { +function twentynineteen_post_classes( $classes, $css_class, $post_id ) { $classes[] = 'entry'; return $classes; diff --git a/wp-content/themes/twentysixteen/inc/template-tags.php b/wp-content/themes/twentysixteen/inc/template-tags.php index 005e5374c5..acb6c9089e 100644 --- a/wp-content/themes/twentysixteen/inc/template-tags.php +++ b/wp-content/themes/twentysixteen/inc/template-tags.php @@ -161,16 +161,16 @@ if ( ! function_exists( 'twentysixteen_excerpt' ) ) : * * @since Twenty Sixteen 1.0 * - * @param string $class Optional. Class string of the div element. Defaults to 'entry-summary'. + * @param string $css_class Optional. Class string of the div element. Defaults to 'entry-summary'. */ - function twentysixteen_excerpt( $class = 'entry-summary' ) { - $class = esc_attr( $class ); + function twentysixteen_excerpt( $css_class = 'entry-summary' ) { + $css_class = esc_attr( $css_class ); if ( has_excerpt() || is_search() ) : ?> -
+
-
+
tags and can only be interpreted as CSS on the browser. diff --git a/wp-includes/version.php b/wp-includes/version.php index b1312e9e6b..3237aa7e76 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta2-53235'; +$wp_version = '6.0-beta2-53236'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.