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
This commit is contained in:
John Blackbourn 2021-07-30 19:35:58 +00:00
parent 166dc3ac8e
commit 2cb4ebefe2
21 changed files with 51 additions and 51 deletions

View File

@ -1014,7 +1014,7 @@ final class WP_Screen {
* @since 3.0.0 * @since 3.0.0
* *
* @param string $screen_settings Screen settings. * @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 ); $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. * @param bool $show_screen Whether to show Screen Options tab.
* Default true. * 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 ); $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
return $this->_show_screen_options; return $this->_show_screen_options;

View File

@ -832,8 +832,8 @@ class WP_Upgrader {
* @since 3.7.0 Added to WP_Upgrader::run(). * @since 3.7.0 Added to WP_Upgrader::run().
* @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`. * @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 * @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. * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
* @param array $hook_extra { * @param array $hook_extra {
* Array of bulk item update data. * Array of bulk item update data.
* *

View File

@ -324,7 +324,7 @@ class WP_Comment_Query {
* *
* @since 4.2.0 * @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 ) ); do_action_ref_array( 'parse_comment_query', array( &$this ) );
} }
@ -370,7 +370,7 @@ class WP_Comment_Query {
* *
* @since 3.1.0 * @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 ) ); do_action_ref_array( 'pre_get_comments', array( &$this ) );

View File

@ -397,7 +397,7 @@ class WP_Customize_Control {
* *
* @since 3.4.0 * @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 ); do_action( 'customize_render_control', $this );
@ -409,7 +409,7 @@ class WP_Customize_Control {
* *
* @since 3.4.0 * @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 ); do_action( "customize_render_control_{$this->id}", $this );

View File

@ -346,7 +346,7 @@ final class WP_Customize_Manager {
* @see WP_Customize_Manager::__construct() * @see WP_Customize_Manager::__construct()
* *
* @param string[] $components Array of core components to load. * @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 ); $components = apply_filters( 'customize_loaded_components', $this->components, $this );
@ -691,7 +691,7 @@ final class WP_Customize_Manager {
* *
* @since 3.4.0 * @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 ); do_action( 'start_previewing_theme', $this );
} }
@ -729,7 +729,7 @@ final class WP_Customize_Manager {
* *
* @since 3.4.0 * @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 ); do_action( 'stop_previewing_theme', $this );
} }
@ -928,7 +928,7 @@ final class WP_Customize_Manager {
* *
* @since 3.4.0 * @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 ); do_action( 'customize_register', $this );
@ -1859,8 +1859,8 @@ final class WP_Customize_Manager {
* *
* @since 4.4.0 * @since 4.4.0
* *
* @param mixed $value Unsanitized setting post value. * @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 ); 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 string $setting_id Setting ID.
* @param mixed $value Unsanitized setting post value. * @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 ); do_action( 'customize_post_value_set', $setting_id, $value, $this );
} }
@ -1937,7 +1937,7 @@ final class WP_Customize_Manager {
* *
* @since 3.4.0 * @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 ); 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' * @param array $response Additional information passed back to the 'saved'
* event on `wp.customize`. * 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 ); $response = apply_filters( 'customize_save_response', $response, $this );
@ -2760,7 +2760,7 @@ final class WP_Customize_Manager {
* *
* @since 4.6.0 * @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 ); do_action( 'customize_save_validation_before', $this );
@ -4754,9 +4754,9 @@ final class WP_Customize_Manager {
* *
* @since 4.2.0 * @since 4.2.0
* *
* @param string[] $nonces Array of refreshed nonces for save and * @param string[] $nonces Array of refreshed nonces for save and
* preview actions. * preview actions.
* @param WP_Customize_Manager $this WP_Customize_Manager instance. * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
*/ */
$nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this ); $nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );

View File

@ -275,7 +275,7 @@ class WP_Customize_Panel {
* *
* @since 4.0.0 * @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 ); do_action( 'customize_render_panel', $this );

View File

@ -298,7 +298,7 @@ class WP_Customize_Section {
* *
* @since 3.4.0 * @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 ); do_action( 'customize_render_section', $this );
/** /**

View File

@ -394,7 +394,7 @@ class WP_Customize_Setting {
* *
* @since 3.4.0 * @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 ); do_action( "customize_preview_{$this->id}", $this );
@ -406,7 +406,7 @@ class WP_Customize_Setting {
* *
* @since 4.1.0 * @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 ); do_action( "customize_preview_{$this->type}", $this );
} }
@ -533,7 +533,7 @@ class WP_Customize_Setting {
* *
* @since 3.4.0 * @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 ); do_action( "customize_save_{$id_base}", $this );
@ -569,8 +569,8 @@ class WP_Customize_Setting {
* *
* @since 3.4.0 * @since 3.4.0
* *
* @param mixed $value Value of the setting. * @param mixed $value Value of the setting.
* @param WP_Customize_Setting $this WP_Customize_Setting instance. * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
*/ */
return apply_filters( "customize_sanitize_{$this->id}", $value, $this ); return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
} }
@ -697,8 +697,8 @@ class WP_Customize_Setting {
* *
* @since 3.4.0 * @since 3.4.0
* *
* @param mixed $value Value of the setting. * @param mixed $value Value of the setting.
* @param WP_Customize_Setting $this WP_Customize_Setting instance. * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
*/ */
do_action( "customize_update_{$this->type}", $value, $this ); do_action( "customize_update_{$this->type}", $value, $this );

View File

@ -555,7 +555,7 @@ class WP_Date_Query {
* @since 3.7.0 * @since 3.7.0
* *
* @param string $where WHERE clause of the date query. * @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 ); return apply_filters( 'get_date_sql', $where, $this );
} }

View File

@ -825,7 +825,7 @@ class WP_Meta_Query {
* @param string|false $alias Table alias, or false if none was found. * @param string|false $alias Table alias, or false if none was found.
* @param array $clause First-order query clause. * @param array $clause First-order query clause.
* @param array $parent_query Parent of $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 ); return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
} }

View File

@ -158,7 +158,7 @@ class WP_Network_Query {
* *
* @since 4.6.0 * @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 ) ); do_action_ref_array( 'parse_network_query', array( &$this ) );
} }
@ -193,7 +193,7 @@ class WP_Network_Query {
* *
* @since 4.6.0 * @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 ) ); do_action_ref_array( 'pre_get_networks', array( &$this ) );

View File

@ -1453,7 +1453,7 @@ class WP_Rewrite {
* *
* @since 1.5.0 * @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 ) ); do_action_ref_array( 'generate_rewrite_rules', array( &$this ) );

View File

@ -296,7 +296,7 @@ class WP_Roles {
* *
* @since 4.7.0 * @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 ); do_action( 'wp_roles_init', $this );
} }

View File

@ -234,7 +234,7 @@ class WP_Site_Query {
* *
* @since 4.6.0 * @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 ) ); do_action_ref_array( 'parse_site_query', array( &$this ) );
} }
@ -278,7 +278,7 @@ class WP_Site_Query {
* *
* @since 4.6.0 * @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 ) ); do_action_ref_array( 'pre_get_sites', array( &$this ) );

View File

@ -280,7 +280,7 @@ class WP_Term_Query {
* *
* @since 4.6.0 * @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 ); do_action( 'parse_term_query', $this );
} }
@ -354,7 +354,7 @@ class WP_Term_Query {
* *
* @since 4.6.0 * @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 ) ); do_action_ref_array( 'pre_get_terms', array( &$this ) );

View File

@ -139,7 +139,7 @@ class WP {
* @since 3.5.0 * @since 3.5.0
* *
* @param bool $bool Whether or not to parse the request. Default true. * @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. * @param array|string $extra_query_vars Extra passed query variables.
*/ */
if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) { if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {
@ -383,7 +383,7 @@ class WP {
* *
* @since 2.1.0 * @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 ) ); do_action_ref_array( 'parse_request', array( &$this ) );
} }
@ -522,7 +522,7 @@ class WP {
* *
* @since 2.1.0 * @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 ) ); do_action_ref_array( 'send_headers', array( &$this ) );
} }
@ -758,7 +758,7 @@ class WP {
* *
* @since 2.1.0 * @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 ) ); do_action_ref_array( 'wp', array( &$this ) );
} }

View File

@ -162,7 +162,7 @@ class WP_Scripts extends WP_Dependencies {
* *
* @since 2.6.0 * @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 ) ); do_action_ref_array( 'wp_default_scripts', array( &$this ) );
} }

View File

@ -130,7 +130,7 @@ class WP_Styles extends WP_Dependencies {
* *
* @since 2.6.0 * @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 ) ); do_action_ref_array( 'wp_default_styles', array( &$this ) );
} }

View File

@ -335,7 +335,7 @@ final class WP_Customize_Selective_Refresh {
* *
* @since 4.5.0 * @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. * @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 array is keyed by partial ID, with each item being an array of
* the placements' context data. * the placements' context data.
@ -384,7 +384,7 @@ final class WP_Customize_Selective_Refresh {
* *
* @since 4.5.0 * @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. * @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 array is keyed by partial ID, with each item being an array of
* the placements' context data. * the placements' context data.

View File

@ -378,8 +378,8 @@ class WP_REST_Request implements ArrayAccess {
* *
* @since 4.4.0 * @since 4.4.0
* *
* @param string[] $order Array of types to check, in order of priority. * @param string[] $order Array of types to check, in order of priority.
* @param WP_REST_Request $this The request object. * @param WP_REST_Request $request The request object.
*/ */
return apply_filters( 'rest_request_parameter_order', $order, $this ); return apply_filters( 'rest_request_parameter_order', $order, $this );
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.