emit_headers() 정적인 공개 메소드

Emits one or more HTTP headers to the output stream
static public emit_headers ( string | array $headers )
$headers string | array
예제 #1
0
 /**
  * @param null|string $name
  */
 function the_header_html($name = null)
 {
     /**
      * This is usually the first method to call in a template so...
      * if ABSPATH is not defined it was called directly. This
      * should only happen when someone is hacking.
      */
     if (!defined('ABSPATH')) {
         WPLib::emit_headers('HTTP/1.0 404 Not Found');
         echo '<h1>Not Found</h1>';
         echo '<p>Requested URL not found.</p>' . exit;
     }
     /**
      * @var WP_Query $wp_query
      */
     global $wp_query;
     /*
      * Make $theme visible inside header.php
      */
     $wp_query->set('theme', WPLib::theme());
     get_header($name);
 }