Skip to content

Instantly share code, notes, and snippets.

View hansschuijff's full-sized avatar

Hans Schuijff hansschuijff

View GitHub Profile
@hansschuijff
hansschuijff / plugin.php
Created October 28, 2019 07:43 — forked from mathetos/plugin.php
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
<!-- 0) Display Medium sized image floated right -->
http://sridharkatakam.com/how-to-display-featured-image-in-single-posts-in-genesis/
$image_args = array(
'size' => 'medium',
'attr' => array(
<?php
/**
* Relocates page titles and adds header image wrapper.
*
* @since 1.0.0
*/
function essence_page_hero_header() {
add_action( 'genesis_before_header', 'essence_header_hero_start' );
add_action( 'genesis_after_header', 'essence_header_title_wrap', 90 );
<?php
/**
* Set the display_logo option to "no" for all mollie payment options
*
* @package DeWittePrins\CoreFunctionality;
* @since 1.7.12
* @author Hans Schuijff
* @link https://dewitteprins.nl
* @license GNU-2.0+
*/
@hansschuijff
hansschuijff / force-display-logo-setting.php
Last active November 11, 2020 13:54
Force the display_logo setting of all Mollie Payment methods to "no"
<?php
/**
* Forces the display_logo setting to "no"
* on all Mollie gateways
*
* @package DeWittePrins\CoreFunctionality;
* @since 1.7.12
* @author Hans Schuijff
* @link https://dewitteprins.nl
* @license GNU-2.0+
@hansschuijff
hansschuijff / add-course-module-to-lesson-admin.php
Created November 29, 2020 22:57
Adds Module taxonomy colum to lessons list and adds it to quick edit
<?php
/**
* Makes the module column in the admin's lesson list sortable.
*
* @package DeWittePrins\CoreFunctionality\SenseiLMS
* @since 1.7.1
* @author Hans Schuijff
* @link https://dewitteprins.nl
* @license GNU-2.0+
*/
@hansschuijff
hansschuijff / core-functionality-custom-remove-filter.php
Created December 13, 2020 20:53
An alternative for remove_filter() that can remove all types of hooked callables.
<?php
/**
* Unhook callbacks from WordPress filter or action hooks.
* including the removal of closures and methods of anonymous objects.
*
* @package DeWittePrins\CoreFunctionality
* @author Hans Schuijff
* @since 1.0.0
* @license GPL-2.0+
**/
@hansschuijff
hansschuijff / disable-plugins-when-doing-local-dev.php
Created December 10, 2019 21:53 — forked from markjaquith/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@hansschuijff
hansschuijff / wcs-remove-my-subscriptions-buttons.php
Created September 6, 2021 20:31 — forked from thenbrent/wcs-remove-my-subscriptions-buttons.php
Remove any given button from the My Subscriptions table on the My Account page. By default, only the "Change Payment Method" button is removed, but you can uncomment additional actions to remove those buttons also.
<?php
/**
* Plugin Name: Remove Subscription Action Buttons from My Account
* Plugin URI: https://gist.github.com/thenbrent/8851287/
* Description: Remove any given button from the <a href="http://docs.woothemes.com/document/subscriptions/customers-view/#section-2">My Subscriptions</a> table on the My Account page. By default, only the "Change Payment Method" button is removed, but you can uncomment additional actions to remove those buttons also.
* Author: Brent Shepherd
* Author URI:
* Version: 2.0
*/