Check for specific post formats with `current_theme_supports()`
|Reported by:||ericmann||Owned by:||duck_|
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
Change History (10)
- Owner set to duck_
- Resolution set to fixed
- Status changed from new to closed