Ejemplo n.º 1
0
 /**
  * Adds a filter hook for an object
  *
  * 	$this->add_action( 'process_action' );
  * 	$this->add_action( 'process_action', 11 );
  * 	$this->add_action( 'process_action', 'special_func' );
  * 	$this->add_action( 'process_action', 'special_func', 11 );
  * 	$this->add_action( 'process_action', array( __CLASS__, 'class_func' ) );
  * 	$this->add_action( 'process_action', array( __CLASS__, 'class_func' ), 11 );
  * 	$this->add_action( 'process_action', new SpecialClass() );
  * 	$this->add_action( 'process_action', new SpecialClass(), 11 );
  *
  * @param string $action_name
  * @param string|array|object|int $callable_object_or_priority Array Callable, String Callable, Class w/Named Action or Priority
  * @param int|null $priority
  *
  * @return mixed
  */
 function add_action($action_name, $callable_object_or_priority = null, $priority = null)
 {
     list($callable, $priority) = $this->_parse_callable_args($action_name, $callable_object_or_priority, $priority);
     if (defined('WP_CONTENT_DIR')) {
         add_action($this->_hash_hook_name($action_name), $callable, $priority, 99);
     } else {
         RESTian::add_action($action_name, $callable, $priority);
     }
 }