Opened 10 years ago
Closed 10 years ago
#24906 closed defect (bug) (fixed)
Post Formats: Allow to check for any post format
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | 3.8 |
Component: | Post Formats | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
It would be great if themes could check if any post format has been assigned to a post. This would make it especially easy to check if no post format has been assigned, something that is hard to do in has_post_format
's current setup.
With the change in r24934 it is only a matter of making the passed format argument optional and checking for it.
Attachments (3)
Change History (7)
#2
@
10 years ago
The use of ! empty( $single )
felt like a code smell — under what circumstances would an item in this array be empty? It seems like that could occur if someone passed false, null, etc., as $format, which would then get converted to array( 0 => false )
.
24906.3.diff tries a different branching of the logic.
Note: See
TracTickets for help on using
tickets.
+1 for this. @obenland: Looks like you missed marking
$format
(optional) in the docblock.We need to update the short description anyway following [24934] since it can (currently) be one or many.