WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When you register a post type you can pass an array of arguments that it "supports." (For example, "page-attributes," "author," "editor," etc.)

I see that get_post_types has some args you can filter by, but how can I filter those that "support" specific features such as "page-attributes" or "author"? I realize I could run a loop to filter after the fact, but can this be done without an extra step?


share|improve this question

Yes, this can be done. Here's how:

get_post_types( array('supports' => array('page-attributes')), 'names', 'OR');

This Trac ticket provides some explanation as to why that last parameter—the 'OR'—is necessary: http://core.trac.wordpress.org/ticket/17620

share|improve this answer
Thanks for the reply. I'm running into the same thing as GaryJ (core.trac.wordpress.org/ticket/17620#comment:2). It's appears to be returning all posts—those that do and don't provide support. I'm just going to stick with subsequent loop using post_type_supports() for now. – robertwbradford Dec 9 '11 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.