Skip to content

Instantly share code, notes, and snippets.

Sybre Waaijer sybrew

Block or report user

Report or block sybrew

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
sybrew / disable-rich-pins.php
Created Aug 13, 2019
Disable Pinterest Rich Pins for your WordPress site.
View disable-rich-pins.php
* Plugin Name: Disable Pinterest rich pins.
* Description: This plugin adds a meta tag to your site header that tells Pinterest to disable rich pins for your WordPress site.
* Version: 1.0.0
* Author: Sybre Waaijer
* Author URI:
* License: GPLv3
sybrew / title-branding.php
Created Jun 20, 2019
Edit TSF title branding
View title-branding.php
// Don't include the PHP tag in existing files.
// Requester:
// Where do I place filters? See:
* Adjust The SEO Framework title branding.
View my-acf-focus-fields.php
// Ref:
* Adds my custom fields to the Focus parser.
* @param array $elements
* @return array
sybrew / tsf-title-date-support.php
Last active Mar 23, 2019
Adds date support for The SEO Framework custom titles
View tsf-title-date-support.php
// DO NOT USE THIS! It's condoned by Google.
// Usage: Add %%year%%, %%month%%, and/or %%day%% to custom meta titles in the SEO framework,
// and magically see them transform into their respective values.
add_filter( 'the_seo_framework_title_from_custom_field', function( $title, $args ) {
$params = [
sybrew / disable-tsf-seo-on-wpforo.php
Last active Sep 17, 2018
Disables The SEO Framework's SEO on wpForo pages.
View disable-tsf-seo-on-wpforo.php
// Don't include the PHP tag.
add_action( 'after_setup_theme', function() {
remove_action( 'init', 'The_SEO_Framework\\_wpforo_fix_page' );
add_action( 'the_seo_framework_init', function() {
if ( ! function_exists( 'wpforo_feature' ) || ! function_exists( 'is_wpforo_page' ) )
sybrew / disable-tsf-on-request.php
Created Apr 16, 2018
Disable TSF when request URL starts with any of the exclusions.
View disable-tsf-on-request.php
//* Don't include the PHP tag.
add_action( 'after_setup_theme', function() {
$exclusions = array(
sybrew / disable-tsf-on-shortcode.php
Last active Sep 16, 2018
Work with TSF v3.0.6 or lower. Disable TSF when shortcodes are found in content.
View disable-tsf-on-shortcode.php
//* Don't include the PHP tag.
add_action( 'the_seo_framework_init', function() {
//! Set shortcodes here.
function get_tsf_excluded_shortcodes() {
return array(
sybrew / ifthisthenthatand.php
Created Mar 13, 2018
A readable if this-then-that-and-else-this-then-that-and... function wrapper.
View ifthisthenthatand.php
function if_( $value ) {
return new class( (bool) $value ) {
public $run, $and;
public $cb = [];
function __construct( $run ) { $this->run = $run; }
function __destruct() {
foreach ( $this->cb as $cb ) {
$cb ? $cb() : null;
sybrew / tsf-test-relative-fontcolor.php
Last active Aug 20, 2018
The testing script used to find issues with the new color calcuation in TSF. Double-click the page to load the next sequence.
View tsf-test-relative-fontcolor.php
<!DOCTYPE html>
div {
padding: 12px 0;
font-weight: 600;
font-size: 14px;
vertical-align: middle;
display: inline-block;
sybrew / remove-editor-requirement.php
Created Feb 9, 2018
Remove editor support requirement in TSF
View remove-editor-requirement.php
//! Don't include the php tag.
add_filter( 'the_seo_framework_custom_post_type_support', function( $support ) {
return array_diff( $support, array( 'editor' ) );
} );
You can’t perform that action at this time.