{"id":6118,"date":"2026-02-13T18:24:30","date_gmt":"2026-02-13T23:24:30","guid":{"rendered":"https:\/\/chubes.net\/?documentation=header-embed-php"},"modified":"2026-03-13T03:29:36","modified_gmt":"2026-03-13T07:29:36","slug":"header-embed-php","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/wordpress-core\/theme-compat\/header-embed-php\/","title":{"rendered":"header-embed.php"},"content":{"rendered":"<p>Embed header template \u2014 HTML document opening for oEmbed iframes.<\/p><p><strong>Source:<\/strong> <code>wp-includes\/theme-compat\/header-embed.php<\/code><br \/>\n<strong>Since:<\/strong> 4.5.0<br \/>\n<strong>Subpackage:<\/strong> Theme_Compat<\/p><hr class=\"wp-block-separator\"\/><h2 class=\"wp-block-heading\">Purpose<\/h2><p>Loaded by <code>get_header( 'embed' )<\/code> when the active theme has no <code>header-embed.php<\/code>. Opens the HTML document for embed output.<\/p><hr class=\"wp-block-separator\"\/><h2 class=\"wp-block-heading\">Behavior<\/h2><ol class=\"wp-block-list\"><li><p><strong>Sets HTTP header:<\/strong> If <code>headers_sent()<\/code> is false, sends <code>X-WP-embed: true<\/code> via <code>header()<\/code>.<\/p><\/li><li><p><strong>Outputs <code>&lt;!DOCTYPE html&gt;<\/code> and <code>&lt;html&gt;<\/code> tag<\/strong> with <code>language_attributes()<\/code> and class <code>no-js<\/code>.<\/p><\/li><li><p><strong><code>&lt;head&gt;<\/code> section:<\/strong><\/p><ul class=\"wp-block-list\"><li><code>&lt;title&gt;<\/code> via <code>wp_get_document_title()<\/code><\/li><li><code>&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<\/code><\/li><li>Fires the <strong><code>embed_head<\/code><\/strong> action<\/li><\/ul><\/li><li><p><strong>Opens <code>&lt;body&gt;<\/code> tag<\/strong> with <code>body_class()<\/code>.<\/p><\/li><\/ol><hr class=\"wp-block-separator\"\/><h2 class=\"wp-block-heading\">Hooks<\/h2><h3 class=\"wp-block-heading\"><code>embed_head<\/code> (action)<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">php<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-php\"><code class=\"language-php\">do_action( &#039;embed_head&#039; );<\/code><\/pre><\/div><p><strong>Sets HTTP header:<\/strong> If <code>headers_sent()<\/code> is false, sends <code>X-WP-embed: true<\/code> via <code>header()<\/code>.<\/p><p><strong>Outputs <code>&lt;!DOCTYPE html&gt;<\/code> and <code>&lt;html&gt;<\/code> tag<\/strong> with <code>language_attributes()<\/code> and class <code>no-js<\/code>.<\/p><hr class=\"wp-block-separator\"\/><h2 class=\"wp-block-heading\">Functions Called<\/h2><figure class=\"wp-block-table\"><table><thead><tr><th>Function<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>headers_sent()<\/code><\/td><td>Check if HTTP headers already sent<\/td><\/tr><tr><td><code>header()<\/code><\/td><td>Send X-WP-embed header<\/td><\/tr><tr><td><code>language_attributes()<\/code><\/td><td>HTML lang attribute<\/td><\/tr><tr><td><code>wp_get_document_title()<\/code><\/td><td>Page title<\/td><\/tr><tr><td><code>do_action()<\/code><\/td><td>Fire <code>embed_head<\/code><\/td><\/tr><tr><td><code>body_class()<\/code><\/td><td>Body CSS classes<\/td><\/tr><\/tbody><\/table><\/figure>","protected":false},"excerpt":{"rendered":"<p>Embed header template \u2014 HTML document opening for oEmbed iframes. Source: wp-includes\/theme-compat\/header-embed.php Since: 4.5.0 Subpackage: Theme_Compat Purpose Loaded by get_header( &#8217;embed&#8217; ) when the active theme has no header-embed.php. Opens&#8230;<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[758],"project_type":[749],"class_list":["post-6118","documentation","type-documentation","status-publish","hentry","project-theme-compat","project_type-wordpress-reference"],"project_info":{"id":589,"name":"WordPress Core","slug":"wordpress-core"},"project_type_info":{"id":749,"name":"WordPress Reference","slug":"wordpress-reference"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/6118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":3,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/6118\/revisions"}],"predecessor-version":[{"id":11038,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/6118\/revisions\/11038"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=6118"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=6118"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=6118"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=6118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}