Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
*/
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
You can’t perform that action at this time.