From 2cb4ebefe2ee98fc36a5962e92590cb0451ad2a6 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 30 Jul 2021 19:35:58 +0000 Subject: [PATCH] Docs: Replace `$this` in hook param docs with more appropriate names. `$this` is a pseudo-variable that cannot be used as the name of a function parameter, so renaming these helps prevent errors when implementing hook callback functions. Fixes #53457 Built from https://develop.svn.wordpress.org/trunk@51518 git-svn-id: http://core.svn.wordpress.org/trunk@51129 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-screen.php | 4 +-- wp-admin/includes/class-wp-upgrader.php | 4 +-- wp-includes/class-wp-comment-query.php | 4 +-- wp-includes/class-wp-customize-control.php | 4 +-- wp-includes/class-wp-customize-manager.php | 26 +++++++++---------- wp-includes/class-wp-customize-panel.php | 2 +- wp-includes/class-wp-customize-section.php | 2 +- wp-includes/class-wp-customize-setting.php | 14 +++++----- wp-includes/class-wp-date-query.php | 2 +- wp-includes/class-wp-meta-query.php | 2 +- wp-includes/class-wp-network-query.php | 4 +-- wp-includes/class-wp-rewrite.php | 2 +- wp-includes/class-wp-roles.php | 2 +- wp-includes/class-wp-site-query.php | 4 +-- wp-includes/class-wp-term-query.php | 4 +-- wp-includes/class-wp.php | 8 +++--- wp-includes/class.wp-scripts.php | 2 +- wp-includes/class.wp-styles.php | 2 +- .../class-wp-customize-selective-refresh.php | 4 +-- .../rest-api/class-wp-rest-request.php | 4 +-- wp-includes/version.php | 2 +- 21 files changed, 51 insertions(+), 51 deletions(-) diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index 57fb4f4038..c49de7dde9 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -1014,7 +1014,7 @@ final class WP_Screen { * @since 3.0.0 * * @param string $screen_settings Screen settings. - * @param WP_Screen $this WP_Screen object. + * @param WP_Screen $screen WP_Screen object. */ $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this ); @@ -1029,7 +1029,7 @@ final class WP_Screen { * * @param bool $show_screen Whether to show Screen Options tab. * Default true. - * @param WP_Screen $this Current WP_Screen instance. + * @param WP_Screen $screen Current WP_Screen instance. */ $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this ); return $this->_show_screen_options; diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 0385eae576..18736720d9 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -832,8 +832,8 @@ class WP_Upgrader { * @since 3.7.0 Added to WP_Upgrader::run(). * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`. * - * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a - * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. + * @param WP_Upgrader $upgrader WP_Upgrader instance. In other contexts this might be a + * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. * @param array $hook_extra { * Array of bulk item update data. * diff --git a/wp-includes/class-wp-comment-query.php b/wp-includes/class-wp-comment-query.php index eb55c91a6e..f35354c76c 100644 --- a/wp-includes/class-wp-comment-query.php +++ b/wp-includes/class-wp-comment-query.php @@ -324,7 +324,7 @@ class WP_Comment_Query { * * @since 4.2.0 * - * @param WP_Comment_Query $this The WP_Comment_Query instance (passed by reference). + * @param WP_Comment_Query $query The WP_Comment_Query instance (passed by reference). */ do_action_ref_array( 'parse_comment_query', array( &$this ) ); } @@ -370,7 +370,7 @@ class WP_Comment_Query { * * @since 3.1.0 * - * @param WP_Comment_Query $this Current instance of WP_Comment_Query (passed by reference). + * @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference). */ do_action_ref_array( 'pre_get_comments', array( &$this ) ); diff --git a/wp-includes/class-wp-customize-control.php b/wp-includes/class-wp-customize-control.php index 04db0d4e4c..ca82dff71e 100644 --- a/wp-includes/class-wp-customize-control.php +++ b/wp-includes/class-wp-customize-control.php @@ -397,7 +397,7 @@ class WP_Customize_Control { * * @since 3.4.0 * - * @param WP_Customize_Control $this WP_Customize_Control instance. + * @param WP_Customize_Control $control WP_Customize_Control instance. */ do_action( 'customize_render_control', $this ); @@ -409,7 +409,7 @@ class WP_Customize_Control { * * @since 3.4.0 * - * @param WP_Customize_Control $this WP_Customize_Control instance. + * @param WP_Customize_Control $control WP_Customize_Control instance. */ do_action( "customize_render_control_{$this->id}", $this ); diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 63d5dc41ff..25660393a0 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -346,7 +346,7 @@ final class WP_Customize_Manager { * @see WP_Customize_Manager::__construct() * * @param string[] $components Array of core components to load. - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ $components = apply_filters( 'customize_loaded_components', $this->components, $this ); @@ -691,7 +691,7 @@ final class WP_Customize_Manager { * * @since 3.4.0 * - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'start_previewing_theme', $this ); } @@ -729,7 +729,7 @@ final class WP_Customize_Manager { * * @since 3.4.0 * - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'stop_previewing_theme', $this ); } @@ -928,7 +928,7 @@ final class WP_Customize_Manager { * * @since 3.4.0 * - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'customize_register', $this ); @@ -1859,8 +1859,8 @@ final class WP_Customize_Manager { * * @since 4.4.0 * - * @param mixed $value Unsanitized setting post value. - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param mixed $value Unsanitized setting post value. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( "customize_post_value_set_{$setting_id}", $value, $this ); @@ -1876,7 +1876,7 @@ final class WP_Customize_Manager { * * @param string $setting_id Setting ID. * @param mixed $value Unsanitized setting post value. - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'customize_post_value_set', $setting_id, $value, $this ); } @@ -1937,7 +1937,7 @@ final class WP_Customize_Manager { * * @since 3.4.0 * - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'customize_preview_init', $this ); } @@ -2592,7 +2592,7 @@ final class WP_Customize_Manager { * * @param array $response Additional information passed back to the 'saved' * event on `wp.customize`. - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ $response = apply_filters( 'customize_save_response', $response, $this ); @@ -2760,7 +2760,7 @@ final class WP_Customize_Manager { * * @since 4.6.0 * - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ do_action( 'customize_save_validation_before', $this ); @@ -4754,9 +4754,9 @@ final class WP_Customize_Manager { * * @since 4.2.0 * - * @param string[] $nonces Array of refreshed nonces for save and - * preview actions. - * @param WP_Customize_Manager $this WP_Customize_Manager instance. + * @param string[] $nonces Array of refreshed nonces for save and + * preview actions. + * @param WP_Customize_Manager $manager WP_Customize_Manager instance. */ $nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this ); diff --git a/wp-includes/class-wp-customize-panel.php b/wp-includes/class-wp-customize-panel.php index 29c023b5fb..71d93ead97 100644 --- a/wp-includes/class-wp-customize-panel.php +++ b/wp-includes/class-wp-customize-panel.php @@ -275,7 +275,7 @@ class WP_Customize_Panel { * * @since 4.0.0 * - * @param WP_Customize_Panel $this WP_Customize_Panel instance. + * @param WP_Customize_Panel $panel WP_Customize_Panel instance. */ do_action( 'customize_render_panel', $this ); diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index 8a843f0fe6..e7484d6f2f 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -298,7 +298,7 @@ class WP_Customize_Section { * * @since 3.4.0 * - * @param WP_Customize_Section $this WP_Customize_Section instance. + * @param WP_Customize_Section $section WP_Customize_Section instance. */ do_action( 'customize_render_section', $this ); /** diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index 4f63937799..752593fa61 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -394,7 +394,7 @@ class WP_Customize_Setting { * * @since 3.4.0 * - * @param WP_Customize_Setting $this WP_Customize_Setting instance. + * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_preview_{$this->id}", $this ); @@ -406,7 +406,7 @@ class WP_Customize_Setting { * * @since 4.1.0 * - * @param WP_Customize_Setting $this WP_Customize_Setting instance. + * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_preview_{$this->type}", $this ); } @@ -533,7 +533,7 @@ class WP_Customize_Setting { * * @since 3.4.0 * - * @param WP_Customize_Setting $this WP_Customize_Setting instance. + * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_save_{$id_base}", $this ); @@ -569,8 +569,8 @@ class WP_Customize_Setting { * * @since 3.4.0 * - * @param mixed $value Value of the setting. - * @param WP_Customize_Setting $this WP_Customize_Setting instance. + * @param mixed $value Value of the setting. + * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ return apply_filters( "customize_sanitize_{$this->id}", $value, $this ); } @@ -697,8 +697,8 @@ class WP_Customize_Setting { * * @since 3.4.0 * - * @param mixed $value Value of the setting. - * @param WP_Customize_Setting $this WP_Customize_Setting instance. + * @param mixed $value Value of the setting. + * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_update_{$this->type}", $value, $this ); diff --git a/wp-includes/class-wp-date-query.php b/wp-includes/class-wp-date-query.php index 855f31d42f..5e916c9165 100644 --- a/wp-includes/class-wp-date-query.php +++ b/wp-includes/class-wp-date-query.php @@ -555,7 +555,7 @@ class WP_Date_Query { * @since 3.7.0 * * @param string $where WHERE clause of the date query. - * @param WP_Date_Query $this The WP_Date_Query instance. + * @param WP_Date_Query $query The WP_Date_Query instance. */ return apply_filters( 'get_date_sql', $where, $this ); } diff --git a/wp-includes/class-wp-meta-query.php b/wp-includes/class-wp-meta-query.php index 5a1b0c4147..4ca9e892b0 100644 --- a/wp-includes/class-wp-meta-query.php +++ b/wp-includes/class-wp-meta-query.php @@ -825,7 +825,7 @@ class WP_Meta_Query { * @param string|false $alias Table alias, or false if none was found. * @param array $clause First-order query clause. * @param array $parent_query Parent of $clause. - * @param WP_Meta_Query $this WP_Meta_Query object. + * @param WP_Meta_Query $query WP_Meta_Query object. */ return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ); } diff --git a/wp-includes/class-wp-network-query.php b/wp-includes/class-wp-network-query.php index 8ddea39ed5..94d89db187 100644 --- a/wp-includes/class-wp-network-query.php +++ b/wp-includes/class-wp-network-query.php @@ -158,7 +158,7 @@ class WP_Network_Query { * * @since 4.6.0 * - * @param WP_Network_Query $this The WP_Network_Query instance (passed by reference). + * @param WP_Network_Query $query The WP_Network_Query instance (passed by reference). */ do_action_ref_array( 'parse_network_query', array( &$this ) ); } @@ -193,7 +193,7 @@ class WP_Network_Query { * * @since 4.6.0 * - * @param WP_Network_Query $this Current instance of WP_Network_Query (passed by reference). + * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference). */ do_action_ref_array( 'pre_get_networks', array( &$this ) ); diff --git a/wp-includes/class-wp-rewrite.php b/wp-includes/class-wp-rewrite.php index c20e768b4b..531707884b 100644 --- a/wp-includes/class-wp-rewrite.php +++ b/wp-includes/class-wp-rewrite.php @@ -1453,7 +1453,7 @@ class WP_Rewrite { * * @since 1.5.0 * - * @param WP_Rewrite $this Current WP_Rewrite instance (passed by reference). + * @param WP_Rewrite $wp_rewrite Current WP_Rewrite instance (passed by reference). */ do_action_ref_array( 'generate_rewrite_rules', array( &$this ) ); diff --git a/wp-includes/class-wp-roles.php b/wp-includes/class-wp-roles.php index 4046862fe2..aa52a106ad 100644 --- a/wp-includes/class-wp-roles.php +++ b/wp-includes/class-wp-roles.php @@ -296,7 +296,7 @@ class WP_Roles { * * @since 4.7.0 * - * @param WP_Roles $this A reference to the WP_Roles object. + * @param WP_Roles $wp_roles A reference to the WP_Roles object. */ do_action( 'wp_roles_init', $this ); } diff --git a/wp-includes/class-wp-site-query.php b/wp-includes/class-wp-site-query.php index 4a9a585b2f..4445f6880f 100644 --- a/wp-includes/class-wp-site-query.php +++ b/wp-includes/class-wp-site-query.php @@ -234,7 +234,7 @@ class WP_Site_Query { * * @since 4.6.0 * - * @param WP_Site_Query $this The WP_Site_Query instance (passed by reference). + * @param WP_Site_Query $query The WP_Site_Query instance (passed by reference). */ do_action_ref_array( 'parse_site_query', array( &$this ) ); } @@ -278,7 +278,7 @@ class WP_Site_Query { * * @since 4.6.0 * - * @param WP_Site_Query $this Current instance of WP_Site_Query (passed by reference). + * @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference). */ do_action_ref_array( 'pre_get_sites', array( &$this ) ); diff --git a/wp-includes/class-wp-term-query.php b/wp-includes/class-wp-term-query.php index 3fd72993cd..f5388e6624 100644 --- a/wp-includes/class-wp-term-query.php +++ b/wp-includes/class-wp-term-query.php @@ -280,7 +280,7 @@ class WP_Term_Query { * * @since 4.6.0 * - * @param WP_Term_Query $this Current instance of WP_Term_Query. + * @param WP_Term_Query $query Current instance of WP_Term_Query. */ do_action( 'parse_term_query', $this ); } @@ -354,7 +354,7 @@ class WP_Term_Query { * * @since 4.6.0 * - * @param WP_Term_Query $this Current instance of WP_Term_Query (passed by reference). + * @param WP_Term_Query $query Current instance of WP_Term_Query (passed by reference). */ do_action_ref_array( 'pre_get_terms', array( &$this ) ); diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 19be051ef9..8c7c48b3b2 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -139,7 +139,7 @@ class WP { * @since 3.5.0 * * @param bool $bool Whether or not to parse the request. Default true. - * @param WP $this Current WordPress environment instance. + * @param WP $wp Current WordPress environment instance. * @param array|string $extra_query_vars Extra passed query variables. */ if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) { @@ -383,7 +383,7 @@ class WP { * * @since 2.1.0 * - * @param WP $this Current WordPress environment instance (passed by reference). + * @param WP $wp Current WordPress environment instance (passed by reference). */ do_action_ref_array( 'parse_request', array( &$this ) ); } @@ -522,7 +522,7 @@ class WP { * * @since 2.1.0 * - * @param WP $this Current WordPress environment instance (passed by reference). + * @param WP $wp Current WordPress environment instance (passed by reference). */ do_action_ref_array( 'send_headers', array( &$this ) ); } @@ -758,7 +758,7 @@ class WP { * * @since 2.1.0 * - * @param WP $this Current WordPress environment instance (passed by reference). + * @param WP $wp Current WordPress environment instance (passed by reference). */ do_action_ref_array( 'wp', array( &$this ) ); } diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index 4d7bd9e1b2..0f38a48618 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -162,7 +162,7 @@ class WP_Scripts extends WP_Dependencies { * * @since 2.6.0 * - * @param WP_Scripts $this WP_Scripts instance (passed by reference). + * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference). */ do_action_ref_array( 'wp_default_scripts', array( &$this ) ); } diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 85589c3987..62def4575c 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -130,7 +130,7 @@ class WP_Styles extends WP_Dependencies { * * @since 2.6.0 * - * @param WP_Styles $this WP_Styles instance (passed by reference). + * @param WP_Styles $wp_styles WP_Styles instance (passed by reference). */ do_action_ref_array( 'wp_default_styles', array( &$this ) ); } diff --git a/wp-includes/customize/class-wp-customize-selective-refresh.php b/wp-includes/customize/class-wp-customize-selective-refresh.php index 9d379af40d..9ab7cce5d7 100644 --- a/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -335,7 +335,7 @@ final class WP_Customize_Selective_Refresh { * * @since 4.5.0 * - * @param WP_Customize_Selective_Refresh $this Selective refresh component. + * @param WP_Customize_Selective_Refresh $refresh Selective refresh component. * @param array $partials Placements' context data for the partials rendered in the request. * The array is keyed by partial ID, with each item being an array of * the placements' context data. @@ -384,7 +384,7 @@ final class WP_Customize_Selective_Refresh { * * @since 4.5.0 * - * @param WP_Customize_Selective_Refresh $this Selective refresh component. + * @param WP_Customize_Selective_Refresh $refresh Selective refresh component. * @param array $partials Placements' context data for the partials rendered in the request. * The array is keyed by partial ID, with each item being an array of * the placements' context data. diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 267ce4e01d..7c8d189906 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -378,8 +378,8 @@ class WP_REST_Request implements ArrayAccess { * * @since 4.4.0 * - * @param string[] $order Array of types to check, in order of priority. - * @param WP_REST_Request $this The request object. + * @param string[] $order Array of types to check, in order of priority. + * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_request_parameter_order', $order, $this ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2cfb4ec7ff..49188894d6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51517'; +$wp_version = '5.9-alpha-51518'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.