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 0
Add a comment  | 

1 Answer 1

Reset to default 0

do you mean something like this?

https://developer.wordpress/reference/hooks/pre_get_posts/

Here you can alter the query before it is actually run.

本文标签: phpIs it possible to change the getposts() or wpquery() function to alter the results that are returned