upgrade 7.6 broke my code: “head> style [amp-boilerplate]”
-
On the update the plugin , again my AMP pages was broken , the message that appeared it is:
Notice: Uninitialized string offset: 0 in /home/escolaedti/public_html/wp-content/plugins/wordpress-seo/frontend/class-twitter.php on line 495
A tag “head > style[amp-boilerplate]” está ausente ou incorreta, mas é exigida pela “noscript > style[amp-boilerplate]”.
translation:
A “head> style [amp-boilerplate]” tag is missing or incorrect, but is required by “noscript> style [amp-boilerplate]”. So how can i fix this? follow to the path /wp-content/plugins/wordpress-seo/frontend/class-twitter.php and change the function to:
/** * Outputs a Twitter image tag for a given image * * @param string $img The source URL to the image. * @param string $tag The tag to output, defaults to image:src but can be altered for use in galleries. * * @return bool */ //protected function image_output( $img, $tag = 'image:src' ) { protected function image_output( $img, $tag = 'image' ) { /** * Filter: 'wpseo_twitter_image' - Allow changing the Twitter Card image * * @api string $img Image URL string */ $img = apply_filters( 'wpseo_twitter_image', $img ); $escaped_img = esc_url( $img ); if ( in_array( $escaped_img, $this->shown_images ) ) { return false; } if ( is_string( $escaped_img ) && $escaped_img !== '' ) { $this->output_metatag( $tag, $escaped_img, true ); array_push( $this->shown_images, $escaped_img ); return true; } return false; }
Now it’s fixed!
Why the developers doesn’t fixed that yet?!?!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘upgrade 7.6 broke my code: “head> style [amp-boilerplate]”’ is closed to new replies.