Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $allProjectArgs = array(
- 'post_type' => 'project',
- 'post_status' => 'publish',
- 'posts_per_page'=> -1,
- 'orderby' => 'favorit_users',
- 'order' => 'DESC',
- 'meta_query' => array(
- 'relation' => 'OR',
- array(
- 'relation' => 'OR',
- array(
- 'key' => 'project_users', // name of custom field
- 'value' => '"'.get_current_user_id().'"',
- 'compare' => 'NOT LIKE'
- ),
- array(
- 'key' => 'project_users', // name of custom field
- 'compare' => 'NOT EXISTS'
- ),
- ),
- array(
- 'relation' => 'AND',
- array(
- 'relation' => 'OR',
- array(
- 'key' => 'project_users', // name of custom field
- 'value' => get_current_user_id(),
- 'compare' => 'NOT LIKE'
- ),
- array(
- 'key' => 'project_users', // name of custom field
- 'compare' => 'NOT EXISTS'
- ),
- ),
- array(
- 'relation' => 'AND',
- 'favorit_users' => array(
- 'key' => 'favorite_users',
- 'value' => get_current_user_id(),
- 'compare' => 'LIKE'
- ),
- ),
- ),
- // array(
- // 'relation' => 'OR',
- // array(
- // "favorit_users" => array(
- // 'key' => 'favorite_users',
- // 'value' => get_current_user_id(),
- // 'compare' => 'LIKE'
- // ),
- // ),
- // ),
- ),
- );
- $allProjectQuery = new WP_Query($allProjectArgs);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement