admin管理员组文章数量:1334678
I have a somewhat difficult question.
Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?
- For example, you want to show some posts/pages with a specific meta lower in the list than other pages
- You want to show the post with post type 'custom' lower in the list than other pages
Is there some hook for this :)?
I have a somewhat difficult question.
Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?
- For example, you want to show some posts/pages with a specific meta lower in the list than other pages
- You want to show the post with post type 'custom' lower in the list than other pages
Is there some hook for this :)?
Share Improve this question asked Jun 9, 2020 at 14:17 Daansk44Daansk44 101 01 Answer
Reset to default 0do you mean something like this?
https://developer.wordpress/reference/hooks/pre_get_posts/
Here you can alter the query before it is actually run.
版权声明:本文标题:php - Is it possible to change the get_posts() or wp_query() function to alter the results that are returned? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742362548a2460645.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论