Last active
May 30, 2021 16:57
-
-
Save westonruter/d13eb0175a22f83c41531e7d1a7071fd to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Disable amp-onerror Handler plugin bootstrap. | |
* | |
* @package Google\AMP_Boilerplate_Error_Handle_Disable | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin | |
* Plugin Name: Disable amp-onerror Handler | |
* Plugin URI: https://gist.github.com/westonruter/d13eb0175a22f83c41531e7d1a7071fd | |
* Description: Temporary workaround until <a href="https://github.com/ampproject/amphtml/issues/22543">amphtml#22543</a> is fixed. | |
* Version: 0.1 | |
* Author: Weston Ruter, Google | |
* Author URI: https://weston.ruter.net/ | |
* License: GNU General Public License v2 (or later) | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* Gist Plugin URI: https://gist.github.com/westonruter/d13eb0175a22f83c41531e7d1a7071fd | |
* Update URI: https://gist.github.com/westonruter/d13eb0175a22f83c41531e7d1a7071fd | |
*/ | |
namespace Google\AMP_Boilerplate_Error_Handle_Disable; | |
add_filter( | |
'amp_optimizer_config', | |
static function ( $config ) { | |
$config['transformers'] = array_diff( | |
$config['transformers'], | |
[ 'AmpProject\Optimizer\Transformer\AmpBoilerplateErrorHandler' ] | |
); | |
return $config; | |
} | |
); |
Thank you, I hope this bug is fixed soon. It affected many posts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation instructions: https://gist.github.com/westonruter/6110fbc4bef0c4b8c021a112012f7e9c