Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34386 closed defect (bug) (invalid)

Get_post_types double calls....

Reported by: selnomeria's profile selnomeria Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:


get_post_types() has argument _builtin, not correctly implemented...

when i created custom QUERY, I have to call that function twice:

$args['post_type'] = array_merge(get_post_types(array('_builtin'=>true)),get_post_types(array('_builtin'=>false)));

so, its good, if there was a value of '_builtin'=>"ALL" , so it gets both of them, not only TRUE or FALSE ones...

It will save DATABASE calls!!

Change History (2)

#1 @SergeyBiryukov
9 years ago

  • Component changed from General to Posts, Post Types

get_post_types() (without a parameter) should return all post types, regardless of the _builtin value.

It also does not perform any database calls, since post types are registered at runtime.

#2 @swissspidy
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

IMHO the docs are clear on this.

Note: See TracTickets for help on using tickets.