Skip to content

Instantly share code, notes, and snippets.

@almone
Forked from jonathanbardo/plugin_extends.php
Created December 11, 2015 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almone/072b0125ff23522917c5 to your computer and use it in GitHub Desktop.
Save almone/072b0125ff23522917c5 to your computer and use it in GitHub Desktop.
Override/Extends a plugin
<?php
/**
* Plugin Name: Extend a plugin
* Version: 0.0.1
* Author: Jonathan Bardo
* License: GPLv2+
* Author URI: http://jonathanbardo.com
*/
class Test extends Date_Range_Filter {
public static function setup() {
parent::setup(); // optionnal
}
public static function OVERRIDE_PARENT_FUNCTION() {
// Isn't that beautiful?
}
}
remove_action( 'plugins_loaded', array( 'Date_Range_Filter', 'setup' ) );
add_action( 'plugins_loaded', array( 'Test', 'setup' ), 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment