Make WordPress Core

Changeset 51518


Ignore:
Timestamp:
07/30/2021 07:34:39 PM (5 years ago)
Author:
johnbillion
Message:

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

Location:
trunk/src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r49946 r51518  
    10151015                 *
    10161016                 * @param string    $screen_settings Screen settings.
    1017                  * @param WP_Screen $this            WP_Screen object.
     1017                 * @param WP_Screen $screen          WP_Screen object.
    10181018                 */
    10191019                $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
     
    10301030                 * @param bool      $show_screen Whether to show Screen Options tab.
    10311031                 *                               Default true.
    1032                  * @param WP_Screen $this        Current WP_Screen instance.
     1032                 * @param WP_Screen $screen      Current WP_Screen instance.
    10331033                 */
    10341034                $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r51329 r51518  
    833833                         * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.
    834834                         *
    835                          * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a
    836                          *                          Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
     835                         * @param WP_Upgrader $upgrader   WP_Upgrader instance. In other contexts this might be a
     836                         *                                Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
    837837                         * @param array       $hook_extra {
    838838                         *     Array of bulk item update data.
  • trunk/src/wp-includes/class-wp-comment-query.php

    r51298 r51518  
    325325                 * @since 4.2.0
    326326                 *
    327                  * @param WP_Comment_Query $this The WP_Comment_Query instance (passed by reference).
     327                 * @param WP_Comment_Query $query The WP_Comment_Query instance (passed by reference).
    328328                 */
    329329                do_action_ref_array( 'parse_comment_query', array( &$this ) );
     
    371371                 * @since 3.1.0
    372372                 *
    373                  * @param WP_Comment_Query $this Current instance of WP_Comment_Query (passed by reference).
     373                 * @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference).
    374374                 */
    375375                do_action_ref_array( 'pre_get_comments', array( &$this ) );
  • trunk/src/wp-includes/class-wp-customize-control.php

    r50996 r51518  
    398398                 * @since 3.4.0
    399399                 *
    400                  * @param WP_Customize_Control $this WP_Customize_Control instance.
     400                 * @param WP_Customize_Control $control WP_Customize_Control instance.
    401401                 */
    402402                do_action( 'customize_render_control', $this );
     
    410410                 * @since 3.4.0
    411411                 *
    412                  * @param WP_Customize_Control $this WP_Customize_Control instance.
     412                 * @param WP_Customize_Control $control WP_Customize_Control instance.
    413413                 */
    414414                do_action( "customize_render_control_{$this->id}", $this );
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r51154 r51518  
    347347                 *
    348348                 * @param string[]             $components Array of core components to load.
    349                  * @param WP_Customize_Manager $this       WP_Customize_Manager instance.
     349                 * @param WP_Customize_Manager $manager   WP_Customize_Manager instance.
    350350                 */
    351351                $components = apply_filters( 'customize_loaded_components', $this->components, $this );
     
    692692                 * @since 3.4.0
    693693                 *
    694                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     694                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    695695                 */
    696696                do_action( 'start_previewing_theme', $this );
     
    730730                 * @since 3.4.0
    731731                 *
    732                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     732                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    733733                 */
    734734                do_action( 'stop_previewing_theme', $this );
     
    929929                 * @since 3.4.0
    930930                 *
    931                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     931                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    932932                 */
    933933                do_action( 'customize_register', $this );
     
    18601860                 * @since 4.4.0
    18611861                 *
    1862                  * @param mixed                $value Unsanitized setting post value.
    1863                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     1862                 * @param mixed                $value   Unsanitized setting post value.
     1863                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    18641864                 */
    18651865                do_action( "customize_post_value_set_{$setting_id}", $value, $this );
     
    18771877                 * @param string               $setting_id Setting ID.
    18781878                 * @param mixed                $value      Unsanitized setting post value.
    1879                  * @param WP_Customize_Manager $this       WP_Customize_Manager instance.
     1879                 * @param WP_Customize_Manager $manager    WP_Customize_Manager instance.
    18801880                 */
    18811881                do_action( 'customize_post_value_set', $setting_id, $value, $this );
     
    19381938                 * @since 3.4.0
    19391939                 *
    1940                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     1940                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    19411941                 */
    19421942                do_action( 'customize_preview_init', $this );
     
    25932593                 * @param array                $response Additional information passed back to the 'saved'
    25942594                 *                                       event on `wp.customize`.
    2595                  * @param WP_Customize_Manager $this     WP_Customize_Manager instance.
     2595                 * @param WP_Customize_Manager $manager  WP_Customize_Manager instance.
    25962596                 */
    25972597                $response = apply_filters( 'customize_save_response', $response, $this );
     
    27612761                 * @since 4.6.0
    27622762                 *
    2763                  * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     2763                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    27642764                 */
    27652765                do_action( 'customize_save_validation_before', $this );
     
    47554755                 * @since 4.2.0
    47564756                 *
    4757                  * @param string[]             $nonces Array of refreshed nonces for save and
    4758                  *                                     preview actions.
    4759                  * @param WP_Customize_Manager $this  WP_Customize_Manager instance.
     4757                 * @param string[]             $nonces  Array of refreshed nonces for save and
     4758                 *                                      preview actions.
     4759                 * @param WP_Customize_Manager $manager WP_Customize_Manager instance.
    47604760                 */
    47614761                $nonces = apply_filters( 'customize_refresh_nonces', $nonces, $this );
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r48111 r51518  
    276276                 * @since 4.0.0
    277277                 *
    278                  * @param WP_Customize_Panel $this WP_Customize_Panel instance.
     278                 * @param WP_Customize_Panel $panel WP_Customize_Panel instance.
    279279                 */
    280280                do_action( 'customize_render_panel', $this );
  • trunk/src/wp-includes/class-wp-customize-section.php

    r47386 r51518  
    299299                 * @since 3.4.0
    300300                 *
    301                  * @param WP_Customize_Section $this WP_Customize_Section instance.
     301                 * @param WP_Customize_Section $section WP_Customize_Section instance.
    302302                 */
    303303                do_action( 'customize_render_section', $this );
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r49946 r51518  
    395395                                 * @since 3.4.0
    396396                                 *
    397                                  * @param WP_Customize_Setting $this WP_Customize_Setting instance.
     397                                 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
    398398                                 */
    399399                                do_action( "customize_preview_{$this->id}", $this );
     
    407407                                 * @since 4.1.0
    408408                                 *
    409                                  * @param WP_Customize_Setting $this WP_Customize_Setting instance.
     409                                 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
    410410                                 */
    411411                                do_action( "customize_preview_{$this->type}", $this );
     
    534534                 * @since 3.4.0
    535535                 *
    536                  * @param WP_Customize_Setting $this WP_Customize_Setting instance.
     536                 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
    537537                 */
    538538                do_action( "customize_save_{$id_base}", $this );
     
    570570                 * @since 3.4.0
    571571                 *
    572                  * @param mixed                $value Value of the setting.
    573                  * @param WP_Customize_Setting $this WP_Customize_Setting instance.
     572                 * @param mixed                $value   Value of the setting.
     573                 * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
    574574                 */
    575575                return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
     
    698698                         * @since 3.4.0
    699699                         *
    700                          * @param mixed                $value Value of the setting.
    701                          * @param WP_Customize_Setting $this WP_Customize_Setting instance.
     700                         * @param mixed                $value   Value of the setting.
     701                         * @param WP_Customize_Setting $setting WP_Customize_Setting instance.
    702702                         */
    703703                        do_action( "customize_update_{$this->type}", $value, $this );
  • trunk/src/wp-includes/class-wp-date-query.php

    r51513 r51518  
    556556                 *
    557557                 * @param string        $where WHERE clause of the date query.
    558                  * @param WP_Date_Query $this The WP_Date_Query instance.
     558                 * @param WP_Date_Query $query The WP_Date_Query instance.
    559559                 */
    560560                return apply_filters( 'get_date_sql', $where, $this );
  • trunk/src/wp-includes/class-wp-meta-query.php

    r50576 r51518  
    826826                 * @param array         $clause       First-order query clause.
    827827                 * @param array         $parent_query Parent of $clause.
    828                  * @param WP_Meta_Query $this         WP_Meta_Query object.
     828                 * @param WP_Meta_Query $query        WP_Meta_Query object.
    829829                 */
    830830                return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
  • trunk/src/wp-includes/class-wp-network-query.php

    r49946 r51518  
    159159                 * @since 4.6.0
    160160                 *
    161                  * @param WP_Network_Query $this The WP_Network_Query instance (passed by reference).
     161                 * @param WP_Network_Query $query The WP_Network_Query instance (passed by reference).
    162162                 */
    163163                do_action_ref_array( 'parse_network_query', array( &$this ) );
     
    194194                 * @since 4.6.0
    195195                 *
    196                  * @param WP_Network_Query $this Current instance of WP_Network_Query (passed by reference).
     196                 * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
    197197                 */
    198198                do_action_ref_array( 'pre_get_networks', array( &$this ) );
  • trunk/src/wp-includes/class-wp-rewrite.php

    r51330 r51518  
    14541454                 * @since 1.5.0
    14551455                 *
    1456                  * @param WP_Rewrite $this Current WP_Rewrite instance (passed by reference).
     1456                 * @param WP_Rewrite $wp_rewrite Current WP_Rewrite instance (passed by reference).
    14571457                 */
    14581458                do_action_ref_array( 'generate_rewrite_rules', array( &$this ) );
  • trunk/src/wp-includes/class-wp-roles.php

    r48586 r51518  
    297297                 * @since 4.7.0
    298298                 *
    299                  * @param WP_Roles $this A reference to the WP_Roles object.
     299                 * @param WP_Roles $wp_roles A reference to the WP_Roles object.
    300300                 */
    301301                do_action( 'wp_roles_init', $this );
  • trunk/src/wp-includes/class-wp-site-query.php

    r51184 r51518  
    235235                 * @since 4.6.0
    236236                 *
    237                  * @param WP_Site_Query $this The WP_Site_Query instance (passed by reference).
     237                 * @param WP_Site_Query $query The WP_Site_Query instance (passed by reference).
    238238                 */
    239239                do_action_ref_array( 'parse_site_query', array( &$this ) );
     
    279279                 * @since 4.6.0
    280280                 *
    281                  * @param WP_Site_Query $this Current instance of WP_Site_Query (passed by reference).
     281                 * @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference).
    282282                 */
    283283                do_action_ref_array( 'pre_get_sites', array( &$this ) );
  • trunk/src/wp-includes/class-wp-term-query.php

    r51301 r51518  
    281281                 * @since 4.6.0
    282282                 *
    283                  * @param WP_Term_Query $this Current instance of WP_Term_Query.
     283                 * @param WP_Term_Query $query Current instance of WP_Term_Query.
    284284                 */
    285285                do_action( 'parse_term_query', $this );
     
    355355                 * @since 4.6.0
    356356                 *
    357                  * @param WP_Term_Query $this Current instance of WP_Term_Query (passed by reference).
     357                 * @param WP_Term_Query $query Current instance of WP_Term_Query (passed by reference).
    358358                 */
    359359                do_action_ref_array( 'pre_get_terms', array( &$this ) );
  • trunk/src/wp-includes/class-wp.php

    r50271 r51518  
    140140                 *
    141141                 * @param bool         $bool             Whether or not to parse the request. Default true.
    142                  * @param WP           $this             Current WordPress environment instance.
     142                 * @param WP           $wp               Current WordPress environment instance.
    143143                 * @param array|string $extra_query_vars Extra passed query variables.
    144144                 */
     
    384384                 * @since 2.1.0
    385385                 *
    386                  * @param WP $this Current WordPress environment instance (passed by reference).
     386                 * @param WP $wp Current WordPress environment instance (passed by reference).
    387387                 */
    388388                do_action_ref_array( 'parse_request', array( &$this ) );
     
    523523                 * @since 2.1.0
    524524                 *
    525                  * @param WP $this Current WordPress environment instance (passed by reference).
     525                 * @param WP $wp Current WordPress environment instance (passed by reference).
    526526                 */
    527527                do_action_ref_array( 'send_headers', array( &$this ) );
     
    759759                 * @since 2.1.0
    760760                 *
    761                  * @param WP $this Current WordPress environment instance (passed by reference).
     761                 * @param WP $wp Current WordPress environment instance (passed by reference).
    762762                 */
    763763                do_action_ref_array( 'wp', array( &$this ) );
  • trunk/src/wp-includes/class.wp-scripts.php

    r50408 r51518  
    163163                 * @since 2.6.0
    164164                 *
    165                  * @param WP_Scripts $this WP_Scripts instance (passed by reference).
     165                 * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference).
    166166                 */
    167167                do_action_ref_array( 'wp_default_scripts', array( &$this ) );
  • trunk/src/wp-includes/class.wp-styles.php

    r50451 r51518  
    131131                 * @since 2.6.0
    132132                 *
    133                  * @param WP_Styles $this WP_Styles instance (passed by reference).
     133                 * @param WP_Styles $wp_styles WP_Styles instance (passed by reference).
    134134                 */
    135135                do_action_ref_array( 'wp_default_styles', array( &$this ) );
  • trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php

    r49946 r51518  
    336336                 * @since 4.5.0
    337337                 *
    338                  * @param WP_Customize_Selective_Refresh $this     Selective refresh component.
     338                 * @param WP_Customize_Selective_Refresh $refresh  Selective refresh component.
    339339                 * @param array                          $partials Placements' context data for the partials rendered in the request.
    340340                 *                                                 The array is keyed by partial ID, with each item being an array of
     
    385385                 * @since 4.5.0
    386386                 *
    387                  * @param WP_Customize_Selective_Refresh $this     Selective refresh component.
     387                 * @param WP_Customize_Selective_Refresh $refresh  Selective refresh component.
    388388                 * @param array                          $partials Placements' context data for the partials rendered in the request.
    389389                 *                                                 The array is keyed by partial ID, with each item being an array of
  • trunk/src/wp-includes/rest-api/class-wp-rest-request.php

    r50150 r51518  
    379379                 * @since 4.4.0
    380380                 *
    381                  * @param string[]        $order Array of types to check, in order of priority.
    382                  * @param WP_REST_Request $this The request object.
     381                 * @param string[]        $order   Array of types to check, in order of priority.
     382                 * @param WP_REST_Request $request The request object.
    383383                 */
    384384                return apply_filters( 'rest_request_parameter_order', $order, $this );
Note: See TracChangeset for help on using the changeset viewer.