src/psr4/Plugin.php
public function add_hooks()
	{
		if ( function_exists( 'add_action' )
			&& function_exists( 'add_filter' )
			&& function_exists( 'add_shortcode' )
		) {
			// Actions
			foreach ( $this->actions as $action ) {
				add_action(
					$action['hook'],
					[ &$this, $this->get_mapped_mvc_call( $action['mvc'] ) ],
					$action['priority'],
					$action['args']
				);
			}
			// Filters
			foreach ( $this->filters as $filter ) {
				add_filter(
					$filter['hook'],
					[ &$this, $this->get_mapped_mvc_call( $filter['mvc'], true ) ],
					$filter['priority'],
					$filter['args']
				);
			}
			// Filters
			foreach ( $this->shortcodes as $shortcode ) {
				add_shortcode(
					$shortcode['tag'],
					[ &$this, $this->get_mapped_mvc_call( $shortcode['mvc'], true ) ]
				);
			}
			// Widgets
			if ( count( $this->widgets ) > 0 ) {
        		add_action( 'widgets_init', [ &$this, '_widgets' ], 1 );
			}
		}
	}
public function add_hooks()
	{
		if ( function_exists( 'add_action' )
			&& function_exists( 'add_filter' )
			&& function_exists( 'add_shortcode' )
		) {
			// Actions
			foreach ( $this->actions as $action ) {
				add_action(
					$action['hook'],
					[ &$this, $this->get_mapped_mvc_call( $action['mvc'] ) ],
					$action['priority'],
					$action['args']
				);
			}
			// Filters
			foreach ( $this->filters as $filter ) {
				add_filter(
					$filter['hook'],
					[ &$this, $this->get_mapped_mvc_call( $filter['mvc'], true ) ],
					$filter['priority'],
					$filter['args']
				);
			}
			// Filters
			foreach ( $this->shortcodes as $shortcode ) {
				add_shortcode(
					$shortcode['tag'],
					[ &$this, $this->get_mapped_mvc_call( $shortcode['mvc'], true ) ]
				);
			}
			// Widgets
			if ( count( $this->widgets ) > 0 ) {
        		add_action( 'widgets_init', [ &$this, '_widgets' ], 1 );
			}
		}
	}
public function add_hooks ( ) { if ( function_exists ( 'add_action' ) && function_exists ( 'add_filter' ) && function_exists ( 'add_shortcode' ) ) { // Actions foreach ( $ this -> actions as $ action ) { add_action ( $ action [ 'hook' ] , [ & $ this , $ this -> get_mapped_mvc_call ( $ action [ 'mvc' ] ) ] , $ action [ 'priority' ] , $ action [ 'args' ] ) ; } // Filters foreach ( $ this -> filters as $ filter ) { add_filter ( $ filter [ 'hook' ] , [ & $ this , $ this -> get_mapped_mvc_call ( $ filter [ 'mvc' ] , true ) ] , $ filter [ 'priority' ] , $ filter [ 'args' ] ) ; } // Filters foreach ( $ this -> shortcodes as $ shortcode ) { add_shortcode ( $ shortcode [ 'tag' ] , [ & $ this , $ this -> get_mapped_mvc_call ( $ shortcode [ 'mvc' ] , true ) ] ) ; } // Widgets if ( count ( $ this -> widgets ) > 0 ) { add_action ( 'widgets_init' , [ & $ this , '_widgets' ] , 1 ) ; } } }
Adds hooks and filters into Wordpress core.
@since 1.3
Adds hooks and filters into Wordpress core .