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