From d398ea806ccad1b25ab8252878ba7b212dd248ee Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 19 May 2014 06:18:51 +0000 Subject: [PATCH] Add missing access modifiers to methods in `WP_Comment_Query`. Add a magic `__call()` method for BC. See #27881, #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@28519 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index d4302a997c..c7d03f685a 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -209,7 +209,7 @@ class WP_Comment_Query { * @access public * @var object WP_Meta_Query */ - var $meta_query = false; + public $meta_query = false; /** * Date query container @@ -218,7 +218,19 @@ class WP_Comment_Query { * @access public * @var object WP_Date_Query */ - var $date_query = false; + public $date_query = false; + + /** + * Make private/protected methods readable for backwards compatibility + * + * @since 4.0.0 + * @param string $name + * @param array $arguments + * @return mixed + */ + public function __call( $name, $arguments ) { + return call_user_func_array( array( $this, $name ), $arguments ); + } /** * Execute the query @@ -228,7 +240,7 @@ class WP_Comment_Query { * @param string|array $query_vars * @return int|array */ - function query( $query_vars ) { + public function query( $query_vars ) { global $wpdb; $defaults = array( @@ -468,7 +480,7 @@ class WP_Comment_Query { * @param array $cols * @return string */ - function get_search_sql( $string, $cols ) { + protected function get_search_sql( $string, $cols ) { $string = esc_sql( like_escape( $string ) ); $searches = array();