_registry->get( 'event.callback.' . $type, $method[0], $method[1] ); $this->register( $hook, $action, $priority, $accepted_args ); } /** * Register a filter. * * @param string $hook Name of the event hook. * @param array $method Method to call. * @param integer $priority Priorify of the event hook execution. * @param integer $accepted_args Number of accepted method parameters. * * @return void */ public function register_filter( $hook, array $method, $priority = 10, $accepted_args = 1 ) { $this->_register( $hook, $method, 'filter', $priority, $accepted_args ); } /** * Register an action. * * @param string $hook Name of the event hook. * @param array $method Method to call. * @param integer $priority Priorify of the event hook execution. * @param integer $accepted_args Number of accepted method parameters. * * @return void */ public function register_action( $hook, array $method, $priority = 10, $accepted_args = 1 ) { $this->_register( $hook, $method, 'action', $priority, $accepted_args ); } /** * Register a shortcode. * * @param string $shortcode Name of the shortcode tag. * @param array $method Method to call. * * @return void */ public function register_shortcode( $shortcode, array $method ) { $entity = $this->_registry->get( 'event.callback.shortcode', $method[0], $method[1] ); add_shortcode( $shortcode, array( $entity, 'run' ) ); return $this; } }