[wp-trac] [WordPress Trac] #58866: Avoid consts inside `locate_template` as it gives incorrect template path after switch_theme

WordPress Trac noreply at wordpress.org
Wed Jul 26 07:35:16 UTC 2023


#58866: Avoid consts inside `locate_template` as it gives incorrect template path
after switch_theme
-------------------------------------------------+-------------------------
 Reporter:  thekt12                              |       Owner:  thekt12
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.4
Component:  Themes                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch reporter-   |     Focuses:  template
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by audrasjb):

 Thanks @joemcgill and @mukesh27 for retrieving the history of this issue.

 By the way, would it be possible to avoid performance issues by storing
 the result of things like `get_stylesheet_directory()` in variables for
 the whole file? So the function calls wouldn't be repeated each time when
 used in a loop.

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


More information about the wp-trac mailing list