[wp-trac] [WordPress Trac] #41714: wp_list_pages() - horrible performance due to eventual "SELECT *"

WordPress Trac noreply at wordpress.org
Fri Aug 25 13:31:38 UTC 2017


#41714: wp_list_pages() - horrible performance due to eventual "SELECT *"
-------------------------------+------------------------------
 Reporter:  DavidAnderson      |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by subrataemfluence):

 If I understand correctly you want more control over core `get_post()`
 method so that you can build a query with specific '''"WHERE"''' filters
 in order to fetch the type of records you want, not just '''"ALL"'''
 posts.

 To achieve this you have the option to build an array and pass it through
 `$args` parameter `get_post()` (`function get_posts( $args = null ) { ...
 }`) method, which by default is set to null. If you do not pass any
 argument, all posts would be retrieved while if you have a properly built
 argument, `get_post()` will use this to fetch matching records according
 to criteria you set in the query.

 [https://developer.wordpress.org/reference/functions/get_posts/]

 I think the following article might also be helpful:
 [https://www.sitepoint.com/exploring-the-wordpress-get_posts-function/]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41714#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list