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-wp-smush-lazy-load.php.diff
diff --git a/core/modules/class-wp-smush-lazy-load.php b/core/modules/class-wp-smush-lazy-load.php
index bf5a447..d612bfc 100644
--- a/core/modules/class-wp-smush-lazy-load.php
+++ b/core/modules/class-wp-smush-lazy-load.php
@@ -60,11 +60,6 @@ class WP_Smush_Lazy_Load extends WP_Smush_Module {
return;
}
- // Skip AMP pages.
- if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
View amp-async-validation.php
<?php
/**
* AMP Async Validation
*
* Installation instructions:
* 1. Click the “Download ZIP” button.
* 2. Rename the downloaded ZIP file to “amp-async-validation.zip”
* 3. In the WordPress admin, go to Plugins > Add New
* 4. Click the Upload Plugin button.
* 5. Select the “amp-async-validation.zip” file and click “Install now”.
View amp-comments-count-in-excerpts.php
<?php
/**
* Plugin Name: AMP Comment Counts in Excerpts
*
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
* Plugin Name: AMP Comment Counts in Excerpts
View class-amp-style-sanitizer.php.diff
diff --git a/includes/sanitizers/class-amp-style-sanitizer.php b/includes/sanitizers/class-amp-style-sanitizer.php
index 988c4942..87d0c470 100644
--- a/includes/sanitizers/class-amp-style-sanitizer.php
+++ b/includes/sanitizers/class-amp-style-sanitizer.php
@@ -667,6 +667,15 @@ class AMP_Style_Sanitizer extends AMP_Base_Sanitizer {
$this->used_attributes[ $attribute_name ] = ( 0 !== $this->xpath->query( $expression )->length );
}
+
+ // Attributes for amp-accordion, see <https://amp.dev/documentation/components/amp-accordion/#styling>.
View amp-anim-to-amp-img.php
<?php
/**
* Convert amp-anim to amp-img
*
* @package AMP_Anim_To_AMP_Img
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
View basic-site-caching.php
<?php
/**
* Plugin Name: Basic Site Caching
*
* @package Basic_Site_Caching
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / pwa-precache-styles.php
Last active Aug 28, 2019
PWA extension plugin to facilitate precaching styles, as an alternative to using WP_Service_Worker_Styles_Integration. See https://wordpress.org/support/topic/precaching-best-practices/
View pwa-precache-styles.php
<?php
/**
* Plugin Name: PWA Precache Styles
*
* @package PWA_Precache_Styles
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google Inc.
*
* @wordpress-plugin
@westonruter
westonruter / landoify.sh
Last active Aug 24, 2019
Put this function in your .bashrc (or the like) to automatically route commands into Lando. Note the PS1 logic may need to be tweaked.
View landoify.sh
function landoify {
shopt -s expand_aliases
# Define aliases for commands to route into the container.
alias npm="lando npm"
alias yarn="lando yarn"
alias npx="lando npx"
alias grunt="lando grunt"
alias gulp="lando gulp"
alias composer="lando composer"
@westonruter
westonruter / wordpress-core-theme-css-changes-5.2.2...5.2.3-RC1.diff
Last active Aug 22, 2019
(PREV_HEAD=5.2.2; NEXT_HEAD=HEAD; git --no-pager diff "$PREV_HEAD...$NEXT_HEAD" $( git ls-files "$NEXT_HEAD" . | ack 'twenty.*\.css$' | grep -v editor | grep -v rtl ))
View wordpress-core-theme-css-changes-5.2.2...5.2.3-RC1.diff
diff --git a/src/wp-content/themes/twentyeleven/style.css b/src/wp-content/themes/twentyeleven/style.css
index 724619ad3a..bda46c7df9 100644
--- a/src/wp-content/themes/twentyeleven/style.css
+++ b/src/wp-content/themes/twentyeleven/style.css
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyeleven/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, suppo
View List_of_languages_by_number_of_native_speakers.html
<table class="wikitable sortable jquery-tablesorter">
<thead>
<tr>
<th class="headerSort headerSortUp" tabindex="0" role="columnheader button" title="Sort descending">Rank</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Language</th>
<th data-sort-type="number" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Native speakers in millions 2007 (2010)</th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Percentage of world population (2007)</th>
</tr>
</thead>
<tbody>
You can’t perform that action at this time.