`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. git-svn-id: https://develop.svn.wordpress.org/trunk@28987 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4e8afc6caa
commit
f8b878f8da
|
@ -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