[wp-trac] [WordPress Trac] #20103: Rewrite get_themes() and other enemies of sanity

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 8 18:06:58 UTC 2012


#20103: Rewrite get_themes() and other enemies of sanity
--------------------------+------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.4
Component:  Themes        |     Version:  1.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------

Comment (by nacin):

 [attachment:20103.4.diff] improves get_theme_root_uri():
  * Short-circuits if only one directory is added (as we do elsewhere)
  * Allows a theme_root to be passed, which would then avoid the call to
 get_raw_theme_root(), which in turn will look up the theme root from the
 transient. If you already have this information, passing it can save some
 execution, especially if this is called for many themes (such as a list of
 screenshots on themes.php).

 Additionally, WP_Theme->get_theme_root_uri() will now call
 get_theme_root_uri(), therefore triggering the theme_root_uri filter. This
 is the only helper method in WP_Theme that wraps its function counterpart.
 This is because it forms the basis for all other URIs returned by the
 theme object. Of all the data points, it's the one we do want to be
 filterable.

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


More information about the wp-trac mailing list