Last active
June 2, 2020 05:50
-
-
Save westonruter/c1496d668b2a73a44aa423e6547a59b7 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 | |
/** | |
* AMP Reject Validation Errors by Default plugin initialization file. | |
* | |
* @package AMP | |
* @author Weston Ruter, Google | |
* @link https://gist.github.com/westonruter/c1496d668b2a73a44aa423e6547a59b7 | |
* @license GPL-2.0-or-later | |
* @copyright 2019 Google Inc. | |
* | |
* @wordpress-plugin | |
* Plugin Name: AMP Reject Validation Errors by Default | |
* Plugin URI: https://gist.github.com/westonruter/c1496d668b2a73a44aa423e6547a59b7 | |
* Description: Reject sanitization of new AMP validation errors by default. When the AMP plugin is in Transitional mode, this means newly-encountered validation errors will cause a request to an AMP page to redirect to the non-AMP page; on Standard mode sites, the AMP attribute will be removed from the HTML element. | |
* Version: 0.1.0 | |
* 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/c1496d668b2a73a44aa423e6547a59b7 | |
*/ | |
add_filter( 'amp_validation_error_default_sanitized', '__return_false' ); |
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