Skip to content

Commit 4205214

Browse files
committed
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 git-svn-id: https://develop.svn.wordpress.org/trunk@51518 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 17fb931 commit 4205214

20 files changed

+50
-50
lines changed

src/wp-admin/includes/class-wp-screen.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ public function show_screen_options() {
10141014
* @since 3.0.0
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 );
10201020

@@ -1029,7 +1029,7 @@ public function show_screen_options() {
10291029
*
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 );
10351035
return $this->_show_screen_options;

src/wp-admin/includes/class-wp-upgrader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ public function run( $options ) {
832832
* @since 3.7.0 Added to WP_Upgrader::run().
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.
839839
*

src/wp-includes/class-wp-comment-query.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function parse_query( $query = '' ) {
324324
*
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 ) );
330330
}
@@ -370,7 +370,7 @@ public function get_comments() {
370370
*
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 ) );
376376

src/wp-includes/class-wp-customize-control.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ final public function maybe_render() {
397397
*
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 );
403403

@@ -409,7 +409,7 @@ final public function maybe_render() {
409409
*
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 );
415415

src/wp-includes/class-wp-customize-manager.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function __construct( $args = array() ) {
346346
* @see WP_Customize_Manager::__construct()
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 );
352352

@@ -691,7 +691,7 @@ public function start_previewing_theme() {
691691
*
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 );
697697
}
@@ -729,7 +729,7 @@ public function stop_previewing_theme() {
729729
*
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 );
735735
}
@@ -928,7 +928,7 @@ public function wp_loaded() {
928928
*
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 );
934934

@@ -1859,8 +1859,8 @@ public function set_post_value( $setting_id, $value ) {
18591859
*
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 );
18661866

@@ -1876,7 +1876,7 @@ public function set_post_value( $setting_id, $value ) {
18761876
*
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 );
18821882
}
@@ -1937,7 +1937,7 @@ public function customize_preview_init() {
19371937
*
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 );
19431943
}
@@ -2592,7 +2592,7 @@ public function save() {
25922592
*
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 );
25982598

@@ -2760,7 +2760,7 @@ function save_changeset_post( $args = array() ) {
27602760
*
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 );
27662766

@@ -4754,9 +4754,9 @@ public function get_nonces() {
47544754
*
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 );
47624762

src/wp-includes/class-wp-customize-panel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ final public function maybe_render() {
275275
*
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 );
281281

src/wp-includes/class-wp-customize-section.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ final public function maybe_render() {
298298
*
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 );
304304
/**

src/wp-includes/class-wp-customize-setting.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public function preview() {
394394
*
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 );
400400

@@ -406,7 +406,7 @@ public function preview() {
406406
*
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 );
412412
}
@@ -533,7 +533,7 @@ final public function save() {
533533
*
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 );
539539

@@ -569,8 +569,8 @@ public function sanitize( $value ) {
569569
*
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 );
576576
}
@@ -697,8 +697,8 @@ protected function update( $value ) {
697697
*
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 );
704704

src/wp-includes/class-wp-date-query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public function get_sql() {
555555
* @since 3.7.0
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 );
561561
}

src/wp-includes/class-wp-meta-query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ protected function find_compatible_table_alias( $clause, $parent_query ) {
825825
* @param string|false $alias Table alias, or false if none was found.
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 );
831831
}

0 commit comments

Comments
 (0)