invalid inline script
. The script contains the following code and the source is wp-includes.
( function() {
var query = document.location.search;
if ( query && query.indexOf( __SINGLE_QUOTED_STRING__ ) !== __INT__ ) {
window.name = __SINGLE_QUOTED_STRING__;
}
if ( window.addEventListener ) {
window.addEventListener( __SINGLE_QUOTED_STRING__, function() { window.name = __SINGLE_QUOTED_STRING__; }, false );
}
}());
I can get rid of that error by reinstalling the AMP plugin, but doing it every time is a little annoying.
]]>I am trying to pull some custom field data (a video embed) into an AMP template. I would like to simply run the built-in sanitizers on the data. I first tried applying filters [apply_filters(‘post_amp_content’,$video_embed) / apply_filters(‘amp_post_template_file’,$video_embed)] but nope, that doesn’t work.
There’s gotta be a simple way to do this?
]]>add_filter( 'amp_content_sanitizers', function( $sanitizers, $post ) {
$sanitizers['AMP_Style_Sanitizer'] = array( 'remove_unused_rules' => 'always', 'dynamic_element_selectors' => array( 'img' ) );
return $sanitizers;
}, 10, 2 );
This does remove unused CSS but still messes with the img selectors.
Is there a way I can get the style sanitizer to ignore img selectors entirely?
]]>I get:
Fatal error: Uncaught Error: Class 'AMP_Rev_Slider_Embed_Handler' not found in ***/public_html/wp-content/plugins/accelerated-mobile-pages/templates/custom-sanitizer.php:71 Stack trace: #0 ***/public_html/wp-content/plugins/accelerated-mobile-pages/templates/custom-sanitizer.php(46): AMPFORWP_Content->register_embed_handlers() #1 ***/public_html/wp-content/plugins/accelerated-mobile-pages/templates/custom-sanitizer.php(27): AMPFORWP_Content->transform() #2 ***/public_html/wp-content/plugins/accelerated-mobile-pages/templates/features.php(6542): AMPFORWP_Content->__construct('<p>Bardzo cieka...', Array, Array) #3 ***/public_html/wp-includes/class-wp-hook.php(286): ampforwp_comments_sanitizer(3892) #4 ***/public_html/wp-includes/ in ***/public_html/wp-content/plugins/accelerated-mobile-pages/templates/custom-sanitizer.php on line 71
While I use Revolution Slider on my site, it’s nowhere to be found on posts.
Posts without comments (0) render fine. Posts with comments render fatal error.
I’m also using wpDiscuz for comments. However, disabling wpDiscuz doesn’t fix the problem.
]]>I just put them back in which is what I want, but it’s a chore!
2. I’m trying to use AMP everywhere, but when I turn on my homepage – which is an archive page for my blog posts – I get another error saying Facebook plugin not used. It seems to be flagging things that aren’t a problem.
Please can you advise? Thanks.
]]>After update to 0.9.97.27 I found some problems on every single posts.
Notice: Undefined index: non-content in /home/www/wp.moika78.ru/prod/releases/178/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php on line 23
It cames 3 times in head, 1 in content, 1 before and after footer.
Image
Sorry, I can’t stay on this version because we need posts without Notices or Errors mainly. But I try to give you any helping info as you ask.
]]>