Skip to content

Commit

Permalink
Pin amp-experiment to v0.1 (#4690)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon authored and westonruter committed May 13, 2020
1 parent fb42d6a commit 0bd9f1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions includes/amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,14 @@ function amp_register_default_scripts( $wp_scripts ) {
null
);
}

if ( $wp_scripts->query( 'amp-experiment', 'registered' ) ) {
/*
* Version 1.0 of amp-experiment is still experimental and requires the user to enable it.
* @todo Revisit once amp-experiment is no longer experimental.
*/
$wp_scripts->registered['amp-experiment']->src = 'https://cdn.ampproject.org/v0/amp-experiment-0.1.js';
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/php/test-class-amp-theme-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -1989,11 +1989,11 @@ static function ( $url ) {
'<link rel="dns-prefetch" href="//cdn.ampproject.org">',
'<link rel="preload" as="script" href="https://cdn.ampproject.org/v0.js">',
'<link rel="preload" as="script" href="https://cdn.ampproject.org/v0/amp-dynamic-css-classes-0.1.js">',
'<link rel="preload" as="script" href="https://cdn.ampproject.org/v0/amp-experiment-1.0.js">',
'<link rel="preload" as="script" href="https://cdn.ampproject.org/v0/amp-experiment-0.1.js">',
'<script type="text/javascript" src="https://cdn.ampproject.org/v0.js" async></script>',

'<script async custom-element="amp-dynamic-css-classes" src="https://cdn.ampproject.org/v0/amp-dynamic-css-classes-0.1.js"></script>',
'<script src="https://cdn.ampproject.org/v0/amp-experiment-1.0.js" async="" custom-element="amp-experiment"></script>',
'<script src="https://cdn.ampproject.org/v0/amp-experiment-0.1.js" async="" custom-element="amp-experiment"></script>',

'#<script( type=[\'"]text/javascript[\'"])? src=[\'"]https\://cdn\.ampproject\.org/v0/amp-ad-0\.1\.js[\'"] async(=[\'"][\'"])? custom-element=[\'"]amp-ad[\'"]>\s*</script>#s',
'#<script src=[\'"]https\://cdn\.ampproject\.org/v0/amp-audio-0\.1\.js[\'"] async(=[\'"][\'"])? custom-element=[\'"]amp-audio[\'"]>\s*</script>#s',
Expand Down

0 comments on commit 0bd9f1c

Please sign in to comment.