[wp-trac] [WordPress Trac] #47154: Prevent "Call to undefined function: get_header()" error in theme files

WordPress Trac noreply at wordpress.org
Fri Apr 5 17:29:53 UTC 2024


#47154: Prevent "Call to undefined function: get_header()" error in theme files
---------------------------+------------------------------
 Reporter:  devonto        |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  5.1.1
 Severity:  minor          |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------

Comment (by devonto):

 If the file is being accessed directly, how else would you suggest
 handling this?

 My suggestion is to change how the core both implements in their own
 themes and recommends to all theme developers that they open their theme
 files with the simple check if ABSPATH is defined.

 Thanks

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


More information about the wp-trac mailing list