print_embed_scripts

Prints the JavaScript in the embed iframe header.

Description

print_embed_scripts(); 

Usage

  1. if ( !function_exists( 'print_embed_scripts' ) ) { 
  2. require_once ABSPATH . WPINC . '/embed.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = print_embed_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/embed.php  
  1. function print_embed_scripts() { 
  2. ?> 
  3. <script type="text/javascript"> 
  4. <?php 
  5. if ( SCRIPT_DEBUG ) { 
  6. readfile( ABSPATH . WPINC . "/js/wp-embed-template.js" ); 
  7. } else { 
  8. /** 
  9. * If you're looking at a src version of this file, you'll see an "include" 
  10. * statement below. This is used by the `grunt build` process to directly 
  11. * include a minified version of wp-embed-template.js, instead of using the 
  12. * readfile() method from above. 
  13. * If you're looking at a build version of this file, you'll see a string of 
  14. * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG 
  15. * and edit wp-embed-template.js directly. 
  16. */ 
  17. ?> 
  18. !function(a, b) {"use strict";function c(b, c) {a.parent.postMessage({message:b, value:c, secret:g}, "*")}function d() {function d() {l.className=l.className.replace("hidden", ""), b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]').focus()}function e() {l.className+=" hidden", b.querySelector(".wp-embed-share-dialog-open").focus()}function f(a) {var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');c.setAttribute("aria-selected", "false"), b.querySelector("#"+c.getAttribute("aria-controls")).setAttribute("aria-hidden", "true"), a.target.setAttribute("aria-selected", "true"), b.querySelector("#"+a.target.getAttribute("aria-controls")).setAttribute("aria-hidden", "false")}function g(a) {var c, d, e=a.target, f=e.parentElement.previousElementSibling, g=e.parentElement.nextElementSibling;if(37===a.keyCode)c=f;else{if(39!==a.keyCode)return!1;c=g}"rtl"===b.documentElement.getAttribute("dir")&&(c=c===f?g:f), c&&(d=c.firstElementChild, e.setAttribute("tabindex", "-1"), e.setAttribute("aria-selected", !1), b.querySelector("#"+e.getAttribute("aria-controls")).setAttribute("aria-hidden", "true"), d.setAttribute("tabindex", "0"), d.setAttribute("aria-selected", "true"), d.focus(), b.querySelector("#"+d.getAttribute("aria-controls")).setAttribute("aria-hidden", "false"))}function h(a) {var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');n!==a.target||a.shiftKey?c===a.target&&a.shiftKey&&(n.focus(), a.preventDefault()):(c.focus(), a.preventDefault())}function i(a) {var b, d=a.target;b=d.hasAttribute("href")?d.getAttribute("href"):d.parentElement.getAttribute("href"), b&&(c("link", b), a.preventDefault())}if(!k) {k=!0;var j, l=b.querySelector(".wp-embed-share-dialog"), m=b.querySelector(".wp-embed-share-dialog-open"), n=b.querySelector(".wp-embed-share-dialog-close"), o=b.querySelectorAll(".wp-embed-share-input"), p=b.querySelectorAll(".wp-embed-share-tab-button button"), q=b.querySelector(".wp-embed-featured-image img");if(o)for(j=0;j<o.length;j++)o[j].addEventListener("click", function(a) {a.target.select()});if(m&&m.addEventListener("click", function() {d()}), n&&n.addEventListener("click", function() {e()}), p)for(j=0;j<p.length;j++)p[j].addEventListener("click", f), p[j].addEventListener("keydown", g);b.addEventListener("keydown", function(a) {27===a.keyCode&&-1===l.className.indexOf("hidden")?e():9===a.keyCode&&h(a)}, !1), a.self!==a.top&&(c("height", Math.ceil(b.body.getBoundingClientRect().height)), q&&q.addEventListener("load", function() {c("height", Math.ceil(b.body.getBoundingClientRect().height))}), b.addEventListener("click", i))}}function e() {a.self!==a.top&&(clearTimeout(i), i=setTimeout(function() {c("height", Math.ceil(b.body.getBoundingClientRect().height))}, 100))}function f() {a.self===a.top||g||(g=a.location.hash.replace(/.*secret=([\d\w]{10}).*/, "$1"), clearTimeout(h), h=setTimeout(function() {f()}, 100))}var g, h, i, j=b.querySelector&&a.addEventListener, k=!1;j&&(f(), b.documentElement.className=b.documentElement.className.replace(/\bno-js\b/, "")+" js", b.addEventListener("DOMContentLoaded", d, !1), a.addEventListener("load", d, !1), a.addEventListener("resize", e, !1))}(window, document); 
  19. <?php 
  20. ?> 
  21. </script> 
  22. <?php