http://example.com/wp-json/wp/v2/posts?author=1
给我作者1的帖子。http://example.com/wp-json/wp/v2/posts?author=1&author=5
只给我5号作者的帖子。有没有办法通过一个请求获得两个不同作者的帖子?http://example.com/wp-json/wp/v2/posts?author=1
给我作者1的帖子。http://example.com/wp-json/wp/v2/posts?author=1&author=5
只给我5号作者的帖子。有没有办法通过一个请求获得两个不同作者的帖子?这个author
请求中的参数似乎映射到author__in
中的参数WP_Query
在这里的rest api调用后面运行,其中逗号分隔的输入:
/wp-json/wp/v2/posts?author=1,5
已转换为array( 1,5 )
的输入author__in
.因此,我正在构建此post query数组:$posts = get_posts(array( \'author\' => $publisher_info-ID, \'post_type\' => \'post\', \'posts_per_page\' => 150, \'meta_query\' => array( array( \'ta