2

i have created table in wordpress like this

/////////////////////////////////////
| id  |   postid  | userid | rating |
| 1   |   ahmed   | 20     | 5      |
| 2   |   john    | 13     | 3      |
| 3   |   sara    | 49     | 10     |
/////////////////////////////////////

and my post has meta key called total_rating so i need to get posts with meta key and custom table if ahmed logged in he should get all posts are belong to him in custom table i use this to get my data

$guide = array(
'post_type' => 'ratings',
'posts_per_page' => -1,
'meta_query' => array(
   'relation' => 'AND',
   array(
     'key' => 'total_rating',
     'compare' => 'EXISTS'
   ), 
   array(
      'taxonomy' => 'new_cats',
      'field'    => 'id',
      'terms'    => array(11,19),
   )
),
);

and my question is how to add custom table to this array above like

if(post and post have meta key and post have taxonomy(11,19) and post have my custom table postid) then display the results

ahmed_omar
  • 49
  • 7

0 Answers0