Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
Revert some of the ampproject#1519 code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
delawski committed Aug 6, 2020
1 parent b7973ee commit 511f277
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions includes/amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,13 @@ function amp_register_default_scripts( $wp_scripts ) {
[],
null
);
$wp_scripts->add_data(
$handle,
'amp_script_attributes',
[
'async' => true,
]
);

// Register all AMP components as defined in the spec.
foreach ( AMP_Allowed_Tags_Generated::get_extension_specs() as $extension_name => $extension_spec ) {
Expand Down Expand Up @@ -1033,8 +1040,8 @@ function amp_render_scripts( $scripts ) {
* @return string Script loader tag.
*/
function amp_filter_script_loader_tag( $tag, $handle ) {
$prefix = 'https://cdn.ampproject.org/';
$src = wp_scripts()->registered[ $handle ]->src;
$prefix = 'https://cdn.ampproject.org/';
$src = wp_scripts()->registered[ $handle ]->src;
if ( 0 !== strpos( $src, $prefix ) ) {
return $tag;
}
Expand Down

0 comments on commit 511f277

Please sign in to comment.