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 amp-suppress-non-admin-validation-error-warnings.php
<?php
/**
* Plugin Name: AMP Suppress Non-Admin Validation Error Warnings
*
* @package AMP_Suppress_Non_Admin_Validation_Error_Warnings
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View geo-mashup-amp-compat.php
<?php
/**
* Plugin Name: Geo Mashup AMP Compat
*
* @package Geo_Mashup_AMP_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / amp-contact-form-7-support.php
Last active Jun 4, 2019
Initial support for forms provided by Contact Form 7 when used with the official AMP plugin. This is not ideal yet as there is no way to force HTML5 required attributes in inputs.
View amp-contact-form-7-support.php
<?php
/**
* Plugin Name: AMP Contact Form 7 Support
*
* @package AMP_Contact_Form_7
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / amp-story-supports-landscape.php
Created May 29, 2019
Enable landscape (desktop) support for stories that have the 'landscape' tag. Requires AMP 1.2-beta2.
View amp-story-supports-landscape.php
<?php
/**
* Plugin Name: AMP Story Supports Landscape
*
* @package AMP_Story_Supports_Landscape
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View test-post-form.php
<?php
/**
* Plugin Name: Non-Redirecting POST Form
* Description: Adds a [test_post_form] shortcode.
* Plugin URI: https://gist.github.com/westonruter/6c0eb253972ccdfc31f841629e2f4344
* Author Name: Weston Ruter
*
* @package Test_Post_Form
*/
@westonruter
westonruter / amp-google-tag-manager.php
Last active Jun 6, 2019
Plugin demonstrating how to inject GTM for the AMP plugin, in response to support forum topic: https://wordpress.org/support/topic/amp-with-google-tag-manager/
View amp-google-tag-manager.php
<?php
/**
* Plugin Name: AMP Google Tag Manager
*
* @package AMP_Google_Tag_Manager
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View try-noscript-style.php
<?php
/*
* Plugin Name: Try Noscript Style
* Plugin URI: https://wordpress.org/support/topic/amp-issues-detected-by-google-search-console/
* Author: Weston Ruter
*/
add_action(
'wp_head',
function() {
@westonruter
westonruter / amp-force-native-mode.php
Created May 17, 2019
The AMP plugin will eventually allow you to switch a theme that declares itself as Transitional (paired=true) to also switch to Native. In the mean time, this plugin can achieve the same effect. For more, see https://github.com/ampproject/amp-wp/issues/2312
View amp-force-native-mode.php
<?php
/**
* AMP Force Native Mode
*
* @package AMP
* @license GPL-2.0+
* @copyright 2019 Google LLC
*
* @wordpress-plugin
* Plugin Name: AMP Force Native Mode
View google-fonts-variable-roboto.md

Examining how Google Fonts returns different Roboto font files for various User-Agent strings. (h/t https://stackoverflow.com/a/27308229/93579)

The src URLs referenced below are what get served to the browsers when they access this font:

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

This is referenced as part of a Tweet. For responding, please reply on Twitter as Gist comments send no notifications.

You can’t perform that action at this time.