Skip to content

Instantly share code, notes, and snippets.

View sybrew's full-sized avatar

Sybre Waaijer sybrew

View GitHub Profile
@sybrew
sybrew / pronamic-ideal-notice-killer.php
Last active April 17, 2016 05:20
Disables Annoying Pronamic iDeal upgrade nag until you reach 15 purchases.
<?php
/**
* Plugin Name: Pronamic IDEAL Notice Killer
* Plugin URI: https://hostmijnpagina.nl/
* Description: Disables Annoying Pronamic iDeal upgrade nag until you reach 15 purchases.
* Version: 1.0.0
* Author: Sybre Waaijer
* Author URI: https://cyberwire.nl/
* License: GPLv3
*/
@sybrew
sybrew / hello.class.php
Last active July 24, 2016 19:08
Hello Dolly OOP example (untested)
<?php
/*
Plugin Name: Hello Dolly OOP example
Plugin URI: https://wordpress.org/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg (and set to OOP by Sybre Waaijer)
Version: 1.6.oop
Author URI: http://ma.tt/
*/
<?php
/**
* Converts array to make a compatible list for both PHP5 and PHP7.
*
* @param array $array The array to convert.
* @return array $list in correct order to use PHPFUNCTION list().
*/
function prepare_list( array $array = array() ) {
if ( PHP_VERSION_ID >= 70000 )
@sybrew
sybrew / remove-woocommerce-message-part.php
Last active October 15, 2021 05:24
Removes "Continue Shopping" message from WooCommerce after item has been added to cart.
<?php
\add_filter( 'wc_add_to_cart_message', function( $string, $product_id = 0 ) {
$start = strpos( $string, '<a href=' ) ?: 0;
$end = strpos( $string, '</a>', $start ) ?: 0;
return substr( $string, $end ) ?: $string;
} );
@sybrew
sybrew / wpforo-tsf.php
Last active March 28, 2017 18:45
wpForo compat
<?php
/**
* wpForo + The SEO Framework compatibility hook.
*/
add_action( 'init', function() {
//* Only work on is_wpforo_page and when the_seo_framework is found.
if ( function_exists( 'the_seo_framework' ) && function_exists( 'is_wpforo_page' ) && is_wpforo_page() ) {
//* Fix titles.
@sybrew
sybrew / search-canonical-push-for-ga.php
Last active April 25, 2019 17:53
Search Canonical Push for Google Analytics
<?php
/**
* Plugin Name: Search Canonical Push for Google Analytics
* Plugin URI: https://theseoframework.com/
* Description: This plugin adds a small script to Search archives that optimizes the Google Analytics script when using pretty Search links.
* Version: 1.0.1
* Author: Sybre Waaijer
* Author URI: https://theseoframework.com/
* License: GPLv3
*/
@sybrew
sybrew / snap-tsf-conflict-unset.php
Created September 21, 2017 17:40
Unsets NextScripts: SNAP from detected plugins
<?php
// Don't include the php tag.
//= First filter: Unsets NextScripts SNAP from check.
add_filter( 'the_seo_framework_conflicting_plugins', function( $plugins ) {
unset( $plugins['open_graph']['NextScripts SNAP'] );
return $plugins;
} );
@sybrew
sybrew / reset-tsfem.php
Created November 13, 2017 10:42
Deletes TSFEM activation settings.
<?php
/**
* Plugin Name: Reset TSFEM activation settings
* Plugin URI: https://theseoframework.com/
* Description: Activate this plugin to remove TSF - Extension Manager activation settings.
* Author: Sybre Waaijer
* Version: 1.0.0
* Author URI: https://cyberwire.nl/
*/
@sybrew
sybrew / reset-tsf-testing-settings.php
Last active December 6, 2017 23:17
Removes TSF testing settings.
<?php
/**
* Plugin Name: Reset TSF testing settings
* Plugin URI: https://theseoframework.com/
* Description: Activate this plugin to remove TSF testing settings.
* Author: Sybre Waaijer
* Version: 1.0.0
* Author URI: https://cyberwire.nl/
*/
@sybrew
sybrew / upgrade-handler.class.php
Created January 6, 2018 01:12
An upgrading class that was planned, but can't work in TSFEM.
<?php
/**
* @package TSF_Extension_Manager/Bootstrap
*/
namespace TSF_Extension_Manager;
defined( 'TSF_EXTENSION_MANAGER_DB_VERSION' ) or die;
/**
* The SEO Framework - Extension Manager plugin