[wp-trac] [WordPress Trac] #18691: Check for specific post formats with `current_theme_supports()`

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 17 18:53:44 UTC 2011


#18691: Check for specific post formats with `current_theme_supports()`
-------------------------+-------------------------------------
 Reporter:  ericmann     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Post Types   |    Version:  3.2.1
 Severity:  normal       |   Keywords:  has-patch needs-testing
-------------------------+-------------------------------------
 A question in IRC reminded me that there's no efficient way to check if a
 specific post format exists.  At the moment, `current_theme_supports()` is
 an all-or-nothing Boolean value ... either the theme supports post formats
 or it doesn't.  There's no way to check for specific support for a
 particular format, say, "aside."

 This could be added to `current_theme_supports()` pretty easily and is
 done so in the attached patch.

 - `current_theme_supports( 'post-formats' )` will return `true` if ''any''
 post format is supported
 - `current_theme_supports( 'post-formats', 'aside' )` will return `true`
 if the "aside" post format is supported

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18691>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list