From e780f28357bc02fe699d706b266639706687fba8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Apr 2022 14:22:21 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@53236 602fd350-edb4-49c9-b593-d223f7449a82 --- .../twentynineteen/inc/template-functions.php | 2 +- .../themes/twentysixteen/inc/template-tags.php | 10 +++++----- src/wp-content/themes/twentythirteen/functions.php | 6 +++--- .../themes/twentytwenty/inc/custom-css.php | 6 +++--- .../themes/twentytwenty/inc/template-tags.php | 14 +++++++------- .../themes/twentytwentyone/inc/custom-css.php | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/wp-content/themes/twentynineteen/inc/template-functions.php b/src/wp-content/themes/twentynineteen/inc/template-functions.php index 301ac23116..6c5a96714e 100644 --- a/src/wp-content/themes/twentynineteen/inc/template-functions.php +++ b/src/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/src/wp-content/themes/twentysixteen/inc/template-tags.php b/src/wp-content/themes/twentysixteen/inc/template-tags.php index 005e5374c5..acb6c9089e 100644 --- a/src/wp-content/themes/twentysixteen/inc/template-tags.php +++ b/src/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.