[wp-trac] [WordPress Trac] #40508: Add new do_action after load template files

WordPress Trac noreply at wordpress.org
Mon Jun 9 08:09:39 UTC 2025


#40508: Add new do_action after load template files
-------------------------------------------------+-------------------------
 Reporter:  rajanit2000                          |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Themes                               |     Version:  5.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-test-info needs-       |     Focuses:  template
  testing                                        |
-------------------------------------------------+-------------------------
Changes (by sainathpoojary):

 * keywords:  has-patch needs-test-info => has-patch has-test-info needs-
     testing


Comment:

 === Testing Instructions

 **Plugin Code:**

 {{{
 <?php
 /**
  * Plugin Name: Test Header Footer Actions
  * Description: Tests the after_get_header and get_footer_after actions
  * Version: 1.0
  */

 add_action('after_get_header', 'test_after_header', 10, 2);
 function test_after_header($name, $args) {
     echo '<!-- Testing after_get_header action -->';
     echo "<!-- Header name: " . esc_html($name) . " -->";
 }

 add_action('get_footer_after', 'test_footer_after', 10, 2);
 function test_footer_after($name, $args) {
     echo '<!-- Testing get_footer_after action -->';
     echo "<!-- Footer name: " . esc_html($name) . " -->";
 }
 }}}

 **Steps to Test:**

 - Activate the **Twenty Seventeen** theme.
 - Install and activate the above test plugin.
 - Visit any frontend page with header and footer (e.g., homepage or a
 single post).
 - View the **page source** (Right-click → "View Page Source").
 - Confirm the following output exists:
   - `<!-- Testing after_get_header action -->`
   - `<!-- Header name: header -->`
   - `<!-- Testing get_footer_after action -->`
   - `<!-- Footer name: footer -->`

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


More information about the wp-trac mailing list