WordPress.org

Make WordPress Core

Ticket #47788: headers.patch

File headers.patch, 1.1 KB (added by pierlo, 21 months ago)

Call callback function for send_headers action hook for admin and login pages

  • src/wp-admin/admin.php

    diff --git src/wp-admin/admin.php src/wp-admin/admin.php
    index 8e2ce255d1..aa8bd97428 100644
    require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); 
    3535
    3636nocache_headers();
    3737
     38// Fires once the requested HTTP headers for caching, content type, etc. have been sent.
     39do_action_ref_array( 'send_headers', array( $wp ) );
     40
    3841if ( get_option( 'db_upgraded' ) ) {
    3942        flush_rewrite_rules();
    4043        update_option( 'db_upgraded', false );
  • src/wp-login.php

    diff --git src/wp-login.php src/wp-login.php
    index f7f0fa16ea..6427b59fbd 100644
    nocache_headers(); 
    493493
    494494header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );
    495495
     496// Fires once the requested HTTP headers for caching, content type, etc. have been sent.
     497do_action_ref_array( 'send_headers', array( $wp ) );
     498
    496499if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set
    497500        if ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] !== $_SERVER['PHP_SELF'] ) ) {
    498501                $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );