[wp-trac] [WordPress Trac] #14720: get_bloginfo code, with get_template_* and get_stylesheet_*

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 28 10:40:00 UTC 2010


#14720: get_bloginfo code, with get_template_* and get_stylesheet_*
--------------------------+-------------------------------------------------
 Reporter:  Frumph        |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:                 
 Severity:  normal        |    Keywords:  close          
--------------------------+-------------------------------------------------

Comment(by nacin):

 Replying to [comment:5 Frumph]:
 > I disagree with never needing the path, for the thought of for example
 checking if a file exists before including it to be one.  I use it quite
 often with ComicPress.
 Sure. If you need the path, then use get_template_directory_uri()... User
 content shouldn't end up in a theme directory, but I'm sure there's a
 valid use case for needing to check if a file exists.

 > I'm not sure this is possible but worth a thought, an addition to the
 bloginfo might be a wp_set_cache that would retain the information for the
 page load instead of calling the functions every time, ...

 These functions are cached at a lower level. Example:

 get_template_directory() calls get_template() (wrapper for get_option(),
 in turn cached via autoloaded options). It also calls get_theme_root(),
 which calls get_theme_roots(), in turn is cached in a site transient,
 which is set by get_themes().

 The _uri() functions call get_theme_root_uri() instead of
 get_theme_root(), which again ends up calling get_theme_roots().

 >Related: #11215
 scribu: Actually, this is confusion over directory versus directory_uri,
 as opposed to child/stylesheet versus parent/template.

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


More information about the wp-trac mailing list