Created
January 29, 2014 12:54
-
-
Save rowatt/8687314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class Presi_Core_Class | |
* | |
* This class doesn't do anything, but provides a framework used by other classes | |
* It is specific to WordPress | |
*/ | |
abstract class Presi_Core_Class | |
{ | |
/** | |
* Wrapper for WP add_action for methods in this class | |
* | |
* @param $hook | |
* @param $method | |
* @param int $priority | |
* @param int $args | |
*/ | |
protected function add_action( $hook, $method, $priority=10, $args=1 ) | |
{ | |
add_action( $hook, array( $this, $method), $priority, $args ); | |
} | |
/** | |
* Wrapper for WP remove_action for methods in this class | |
* | |
* @param $hook | |
* @param $method | |
* @param int $priority | |
* @param int $args | |
*/ | |
protected function remove_action( $hook, $method, $priority=10, $args=1 ) | |
{ | |
remove_action( $hook, array( $this, $method), $priority, $args ); | |
} | |
/** | |
* Wrapper for WP add_filter for methods in this class | |
* | |
* @param $hook | |
* @param $method | |
* @param int $priority | |
* @param int $args | |
*/ | |
protected function add_filter( $hook, $method, $priority=10, $args=1 ) | |
{ | |
add_filter( $hook, array( $this, $method ), $priority, $args ); | |
} | |
/** | |
* Wrapper for WP remove_filter for methods in this class | |
* | |
* @param $hook | |
* @param $method | |
* @param int $priority | |
* @param int $args | |
*/ | |
protected function remove_filter( $hook, $method, $priority=10, $args=1 ) | |
{ | |
remove_filter( $hook, array( $this, $method ), $priority, $args ); | |
} | |
} | |
/* EOF */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment