Skip to content

Instantly share code, notes, and snippets.

View paulgibbs's full-sized avatar

Paul Wong-Gibbs paulgibbs

View GitHub Profile
@paulgibbs
paulgibbs / disable-gutenberg.php
Last active December 14, 2018 14:35
Disable Gutenberg
<?php
/**
* Plugin Name: Disable Gutenberg
*/
add_filter('use_block_editor_for_post', '__return_false');
+----------------+--------------------------------+-------------------------+-------------+--------+---------------------+
| language | english_name | native_name | status | update | updated |
+----------------+--------------------------------+-------------------------+-------------+--------+---------------------+
| de_CH | German (Switzerland) | Deutsch (Schweiz) | uninstalled | none | 2018-07-08 16:40:04 |
| de_CH_informal | German (Switzerland, Informal) | Deutsch (Schweiz, Du) | uninstalled | none | 2018-07-08 16:42:22 |
| de_DE | German | Deutsch | uninstalled | none | 2018-07-10 10:18:08 |
| de_DE_formal | German (Formal) | Deutsch (Sie) | uninstalled | none | 2018-07-10 10:21:23 |
| es_AR | Spanish (Argentina) | Español de Argentina | uninstalled | none | 2018-06-16 04:48:17 |
| es_CL | Spanish (Chile)
@paulgibbs
paulgibbs / bookmark.js
Created March 18, 2016 11:08
Google AMP bookmarklet
javascript:void((function(){var loc = location.href; loc.indexOf("?") == -1 ? (location.href = loc+"?amp=1#development=1") : (location.href = loc+"&amp=1#development=1");})());
diff --git a/src/humans.txt b/src/humans.txt
index 5af7e71a4..6306ece57 100644
--- a/src/humans.txt
+++ b/src/humans.txt
@@ -99,6 +99,10 @@ Title: Core Developer
Twitter: slaFFik
Favorite Food: Cakes
+Name: Venutius
+Title: Community Support
default:
suites:
default:
contexts:
- PaulGibbs\WordpressBehatExtension\Context\SiteContext
- PaulGibbs\WordpressBehatExtension\Context\WordpressContext
- Behat\MinkExtension\Context\MinkContext
- PaulGibbs\WordpressBehatExtension\Context\ContentContext
- PaulGibbs\WordpressBehatExtension\Context\DashboardContext
- PaulGibbs\WordpressBehatExtension\Context\UserContext
* Use a Post Type for email templates.
* The intention is to use the standard wp-admin interface to allow people to change the contents of the email.
* Mustache-like token syntax.
* Use the WP Customiser to visually customise those emails.
* Use a Taxonomy to store the distinct types of emails we send (e.g. new_user, new_site, new_activity_mention, etc).
* Add a HTML email template for the post type.
Direct calls to `wp_mail()` replaced with custom function `bp_send_mail()` that, basically, wraps `wp_mail`:
* I surveyed all the mail replacement plugins I could find (like Mandrill's), and they all re-declare `wp_mail` to implement support for their custom service. Therefore, if `wp_mail()` is redeclared, *or* something has been filtered to get WP to send HTML emails, I'm assuming there's some dark voodoo at work -- and for reasons of trying to be compatible as possible, BP will treat emails the same way it does today (we'll pass it straight through to whatever `wp_mail()` is).
* `bp_send_mail` does three
@paulgibbs
paulgibbs / phpcs.xml.dist
Last active February 11, 2018 14:39
BP Nouveau phpcs.xml.dist
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>Apply WordPress Coding Standards to all Core files</description>
<rule ref="WordPress-Core">
<exclude name="WordPress.PHP.YodaConditions.NotYoda" />
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" />
<exclude name="WordPress.WP.PreparedSQL.NotPrepared" />
@paulgibbs
paulgibbs / gist:8b45ec1edfa0dc724e7a0819896299f8
Created August 2, 2017 15:15
Remove bbPress script/style from non-bbPress pages.
<?php
/**
* Remove bbPress script/style from non-bbPress pages.
*
* @param \BBP_Theme_Compat $bbpress_theme bbPress' theme object.
*/
add_action( 'bbp_theme_compat_actions', function( $bbpress_theme ) {
if ( is_bbpress() ) {
return;
}
@paulgibbs
paulgibbs / gist:6138839
Last active January 28, 2018 10:11
add more properties to add-meta-tags properties
<?php
function pg_filter_metatags( $tags ) {
$tags = str_replace( 'meta name="description"', 'meta name="description" itemprop="description"', $tags );
$tags = str_replace( 'meta name="keywords"', 'meta name="keywords" itemprop="keywords"', $tags );
return $tags;
}
add_filter( 'amt_metatags', 'pg_filter_metatags' );