Last active
June 8, 2020 10:34
-
-
Save vanduc1102/c69f20c3757c2f19c1748a15e5e2dac3 to your computer and use it in GitHub Desktop.
ampforwp add component script, e.g: amp-accordion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_add_amp_component_script( $data ) { | |
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js'; | |
return $data; | |
} | |
add_filter( 'amp_post_template_data', 'prefix_add_amp_component_script' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment