Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #470 #471

Closed
wants to merge 1 commit into from
Closed

Fix #470 #471

wants to merge 1 commit into from

Conversation

janboddez
Copy link
Contributor

By reassigning $query, you break most that comes after.

Also, current( $query->query_vars['meta_query'] ) can return a string ... See the example in the docs, where current( $query->query_vars['meta_query'] ) would return 'AND':

$args = array(
	'meta_query' => array(
		'relation' => 'AND',
		array(
			'key' => 'featured',
			'value' => '1'
		),
		array(
			'key' => 'buried',
			'value' => '1',
			'type' => 'numeric',
			'compare' => '!='
		)
	)
 );

But in general, $query, which is passed to the callback by reference, should not be reassigned.

@pfefferle
Copy link
Owner

Oh, seems that we both did that in parallel :)

@pfefferle pfefferle closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants