`WP_Query::parse_tax_query()` has always been documented as `protected`. Plugins should never have used it. However, it did not have a `protected` access modifier, so its visibility was `public` by default. If the access modifier had been present, accessing the method in a plugin would have produced a fatal error. The access modifier was added in [28523], along with magic methods to allow it to be accessed for BC. This one method is problematic because it expects to be passed a reference. The `WP_Query::__call()` logic does not go out of its way to fix this signature discrepancy, and so a warning is thrown: `Parameter 1 to WP_Query::parse_tax_query() expected to be a reference, value given`.
Remove the `protected` access modifier from `WP_Query::parse_tax_query()`. Fixes #28739. Built from https://develop.svn.wordpress.org/trunk@28987 git-svn-id: http://core.svn.wordpress.org/trunk@28776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5eb23f8e3c
commit
9d123aa326
|
@ -1822,7 +1822,7 @@ class WP_Query {
|
|||
*
|
||||
* @param array &$q The query variables
|
||||
*/
|
||||
protected function parse_tax_query( &$q ) {
|
||||
function parse_tax_query( &$q ) {
|
||||
if ( ! empty( $q['tax_query'] ) && is_array( $q['tax_query'] ) ) {
|
||||
$tax_query = $q['tax_query'];
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue