如果将fields参数指定为“ids”,则我的WP\\U查询工作正常(但我需要所有文件)。
$query3 = new WP_Query(array(\'post_type\' => array(\'post\'),
\'posts_per_page\' => -1,
\'fields\' => \'ids\',
\'date_query\' => array(
array(
\'column\' => \'post_modified_gmt\',
\'after\' => \'1 month ago\'
)
)
));
[request] => SELECT x_posts.ID FROM x_posts WHERE 1=1 AND (
x_posts.post_modified_gmt > \'2017-08-27 12:02:06\'
) AND x_posts.post_type = \'post\' AND (x_posts.post_status = \'publish\')
ORDER BY x_posts.post_date DESC
[post_count] => 14
[found_posts] => 14
[max_num_pages] => 0
[max_num_comment_pages] => 0
如果我不使用fields参数。我明白了。
[post_count] => 215
[found_posts] => 14
但SQL查询是正确的。
[request] => SELECT x_posts.* FROM x_posts WHERE 1=1 AND (
x_posts.post_modified_gmt > \'2017-08-27 12:02:06\'
) AND x_posts.post_type = \'post\' AND (x_posts.post_status = \'publish\')
ORDER BY x_posts.post_date DESC
我怎样才能修复它?