Skip to content

Instantly share code, notes, and snippets.

@rowatt
Created January 29, 2014 12:54
Show Gist options
  • Save rowatt/8687314 to your computer and use it in GitHub Desktop.
Save rowatt/8687314 to your computer and use it in GitHub Desktop.
<?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