[wp-trac] [WordPress Trac] #51691: Call get_template_directory() once instead of multiple times for loading theme's files (performance boost)

WordPress Trac noreply at wordpress.org
Sun Nov 1 19:17:42 UTC 2020


#51691: Call get_template_directory() once instead of multiple times for loading
theme's files (performance boost)
----------------------------+------------------------------
 Reporter:  hellofromTonya  |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bundled Theme   |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  performance
----------------------------+------------------------------

Comment (by hellofromTonya):

 Replying to [comment:2 audrasjb]:
 >but bad in terms of training/learning.

 How so? Shouldn't we also be teaching more performant approaches to
 building themes?


 Replying to [comment:2 audrasjb]:
 >Also, the five hooks you mentioned are here for a reason. I think
 removing them on existing bundled theme is not a good option as it may
 introduce backward compatibility issues with plugins and custom
 developments that use those functions/hooks to override the defaults
 settings.

 The file's path/filename is not passed to the function. What is the
 advantage of having these filters run for each theme file that is loaded?
 ''curious''

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51691#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list