admin管理员组文章数量:1406177
I want to stop this query from running:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_author IN (1) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 3
Apparently / can be tried for this. But if I try the following code in functions.php of the active theme:
apply_filters( 'SELECT SQL_CALC_FOUND_ROWS wpxt_posts.ID FROM wpxt_posts WHERE 1=1 AND wpxt_posts.post_author IN (1) AND wpxt_posts.post_type = \'post\' AND (wpxt_posts.post_status = \'publish\') ORDER BY wpxt_posts.post_date DESC LIMIT 0, 3', string $query )
(escaping quotes)
or:
apply_filters( 'SELECT SQL_CALC_FOUND_ROWS wpxt_posts.ID FROM wpxt_posts WHERE 1=1 AND wpxt_posts.post_author IN (1) AND wpxt_posts.post_type = 'post' AND (wpxt_posts.post_status = 'publish') ORDER BY wpxt_posts.post_date DESC LIMIT 0, 3', string $query )
There are errors. How should this be used in this case?
Edit: The 'duplicate' given does not explain how to use the / function as this question is asking.
本文标签: How to use the query hookfilter
版权声明:本文标题:How to use the query hookfilter? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744972909a2635341.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论