1

我已经像这样在wordpress中创建了表格

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

并且我的帖子有名为 total_rating 的元键,所以我需要使用元键和自定义表获取帖子,如果 ahmed 登录他应该在自定义表中获取所有帖子属于他我用它来获取我的数据

$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),
   )
),
);

我的问题是如何将自定义表添加到上面的这个数组中

如果(post 和 post 有元键并且 post 有分类(11,19)并且 post 有我的自定义表 postid)然后显示结果

4

0 回答 0