From 2486c13ee73b87e3423149e7fe368e33696a4cd4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Nov 2020 20:07:57 +0000 Subject: [PATCH] Users: Use `do_action_ref_array()` for `pre_get_users` and `pre_get_terms` actions. This brings some consistency with the other similar actions: * `pre_get_comments` * `pre_get_networks` * `pre_get_posts` * `pre_get_sites` * `pre_user_query` Follow-up to [29363] and [37572]. Props andy, adamsilverstein, hellofromTonya, desrosj, SergeyBiryukov. Fixes #50961. git-svn-id: https://develop.svn.wordpress.org/trunk@49637 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-term-query.php | 4 ++-- src/wp-includes/class-wp-user-query.php | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/class-wp-term-query.php b/src/wp-includes/class-wp-term-query.php index a78f2e2794..b5cb03f55f 100644 --- a/src/wp-includes/class-wp-term-query.php +++ b/src/wp-includes/class-wp-term-query.php @@ -321,9 +321,9 @@ class WP_Term_Query { * * @since 4.6.0 * - * @param WP_Term_Query $this Current instance of WP_Term_Query. + * @param WP_Term_Query $this Current instance of WP_Term_Query (passed by reference). */ - do_action( 'pre_get_terms', $this ); + do_action_ref_array( 'pre_get_terms', array( &$this ) ); $taxonomies = (array) $args['taxonomy']; diff --git a/src/wp-includes/class-wp-user-query.php b/src/wp-includes/class-wp-user-query.php index 967c6b6b05..f5eac1b7e4 100644 --- a/src/wp-includes/class-wp-user-query.php +++ b/src/wp-includes/class-wp-user-query.php @@ -219,15 +219,14 @@ class WP_User_Query { /** * Fires before the WP_User_Query has been parsed. * - * The passed WP_User_Query object contains the query variables, not - * yet passed into SQL. + * The passed WP_User_Query object contains the query variables, + * not yet passed into SQL. * * @since 4.0.0 * - * @param WP_User_Query $this The current WP_User_Query instance, - * passed by reference. + * @param WP_User_Query $this Current instance of WP_User_Query (passed by reference). */ - do_action( 'pre_get_users', $this ); + do_action_ref_array( 'pre_get_users', array( &$this ) ); // Ensure that query vars are filled after 'pre_get_users'. $qv =& $this->query_vars; @@ -576,8 +575,7 @@ class WP_User_Query { * * @since 3.1.0 * - * @param WP_User_Query $this The current WP_User_Query instance, - * passed by reference. + * @param WP_User_Query $this Current instance of WP_User_Query (passed by reference). */ do_action_ref_array( 'pre_user_query', array( &$this ) ); }