[wp-trac] [WordPress Trac] #21479: Twenty Twelve: hide category and tag output in post meta if only 1 term

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 5 22:31:22 UTC 2012


#21479: Twenty Twelve: hide category and tag output in post meta if only 1 term
---------------------------+------------------
 Reporter:  lancewillett   |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.5
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |
---------------------------+------------------
Changes (by jkudish):

 * cc: joachim.kudish@… (added)


Comment:

 In [https://core.trac.wordpress.org/attachment/ticket/21479/21479.2.patch
 21479.2.patch], I've simplified and cleaned up the function in several
 ways:

 * I don't think it helps anything to cache the function in a transient as
 `get_categories` calls `get_terms` which has caching built-in
 * Renamed the function to 'twentytwelve_is_categorized_site' to be a bit
 more descriptive about what it does
 * Renamed the variable `$all_the_cool_cats` to `$non_empty_categories` to
 be a bit more descriptive about it is
 * Simplified the if statements

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21479#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list