Skip to content

Instantly share code, notes, and snippets.

Weston Ruter westonruter

Block or report user

Report or block westonruter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View class-amp-base-sanitizer.php.diff
diff --git a/includes/sanitizers/class-amp-base-sanitizer.php b/includes/sanitizers/class-amp-base-sanitizer.php
index 2482db29..e2171079 100644
--- a/includes/sanitizers/class-amp-base-sanitizer.php
+++ b/includes/sanitizers/class-amp-base-sanitizer.php
@@ -486,8 +486,12 @@ abstract class AMP_Base_Sanitizer {
}
$should_remove = $this->should_sanitize_validation_error( $validation_error, compact( 'node' ) );
if ( $should_remove ) {
- $element->removeAttributeNode( $node );
- $this->clean_up_after_attribute_removal( $element, $node, $validation_error );
@westonruter
westonruter / amp-brid-player.php
Last active Oct 29, 2019
AMP Brid Player plugin for WordPress, with support for non-AMP fallback: https://github.com/ampproject/amp-wp/issues/3638
View amp-brid-player.php
<?php
/**
* AMP Brid Player
*
* Installation instructions:
* 1. Click the “Download ZIP” button.
* 2. Rename the downloaded ZIP file to “amp-brid-player.zip”
* 3. In the WordPress admin, go to Plugins > Add New
* 4. Click the Upload Plugin button.
* 5. Select the “amp-brid-player.zip” file and click “Install now”.
@westonruter
westonruter / amp-inline-script-test.php
Last active Oct 25, 2019
Plugin to test inline amp-script support in the the AMP plugin. Depends on https://github.com/ampproject/amp-wp/pull/3619
View amp-inline-script-test.php
<?php
/**
* AMP Inline Script Test
*
* @package AMP_Inline_Script_Test
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View amp-validation-error-source-file-idea-editor.php
<?php
/**
* AMP Validation Error Source File IntelliJ IDEA Editor.
*
* @package AMP_Validation_Error_Source_File_Idea_Editor
* @author Weston Ruter, Google
* @link https://gist.github.com/westonruter/1a36a78a79fb1abbdfd1bb5b38a9f3a1
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
View amp-reject-validation-errors-by-default.php
<?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.
*
View ultimate-blocks-countdown-amp.php
<?php
/**
* AMP-compatible Countdown Block
*
* @package AMP_UB_Countdown_Block
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View amp-workaround-meta-http-equiv-content-type.php
<?php
/**
* AMP Workaround meta[http-equiv=Content-Type]
*
* @package AMP_Workaround_Meta_Content_Type
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / functions.php
Last active Nov 5, 2019
Child theme of Noto Simple with full AMP compatibility
View functions.php
<?php
/**
* Noto Simple AMP functions and definitions
*
* @package Noto_Simple_AMP
*/
// Indicate that the theme works well in both Standard and Transitional template modes.
add_theme_support(
'amp',
View amp-sanitize-processing-instructions.php
<?php
/**
* AMP Sanitize Processing Instructions
*
* @package AMP_Sanitize_PIs
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View amp-query-monitor-compat.php
<?php
/**
* AMP Query Monitor Compat
*
* @package AMP_Query_Monitor_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google LLC
*
* @wordpress-plugin
You can’t perform that action at this time.