diff --git a/Execute a function on a child site/AMP/amp-preload-runtime-scripts.txt b/Execute a function on a child site/AMP/amp-preload-runtime-scripts.txt new file mode 100644 index 00000000..b2d3f86e --- /dev/null +++ b/Execute a function on a child site/AMP/amp-preload-runtime-scripts.txt @@ -0,0 +1,10 @@ +/** + * Preload AMP runtime scripts. + */ +function amp_preload_amp_runtime() { + echo sprintf( '', esc_url( 'https://cdn.ampproject.org/v0.js' ) ); + echo sprintf( '', esc_url( 'https://cdn.ampproject.org/v0.mjs' ) ); +} + +add_action( 'wp_head', 'amp_preload_amp_runtime' ); +add_action( 'amp_post_template_head', 'amp_preload_amp_runtime' );