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/
*
*/
@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/
*/
# 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 / install-wp-plugins.php
Last active April 1, 2024 05:03 — forked from squarestar/install-wp-plugins.php
Programmatically install and activate wordpress plugins
<?php
/**
* Plugin Name: Activate required plugins.
* Description: Programmatically install and activate plugins based on a runtime config.
* Version: 1.0
* Author: Hans Schuijff
* Author URI: http://dewitteprins.nl
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/