Skip to content

Instantly share code, notes, and snippets.

@skmohammadi
Last active August 1, 2021 21:18
Embed
What would you like to do?
Search Post Title OR Meta with WP_Query
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
's' => 'سامسونگ',
'meta_query' => array(
array(
'key' => 'brand',
'value' => 'سامسونگ',
'compare' => 'LIKE',
),
),
);
$query = new WP_Query($args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment