Best Jquery ,javascript, HTML5 CSS3 tutorial with jquery examples, php script , demos for beginners, web designers and web developers.

Jquery

Jquery Training

Jquery training blog

How to display all hooks running on WordPress page?

WordPress hooks are importent part of WordPress devloper. Hooks are the core functionality of WordPress providing the ability to “hook into” your code in the wordpress code without modifying the core. Hooks basically calls a function to run at a specific time. There are two type of hooks : 1) Action hook 2) Filter hook Continue Reading



WordPress hooks are importent part of WordPress devloper. Hooks are the core functionality of WordPress providing the ability to “hook into” your code in the wordpress code without modifying the core. Hooks basically calls a function to run at a specific time.

There are two type of hooks :
1) Action hook
2) Filter hook

Action hook is triggered at specific time when WordPress is running and lets you take an action in WordPress.
Filter hook allows you get and modify data before it is sent the browser or to the database .

Example of action hook :

Define action hook function :
function my_action_function() {
  wp_enqueue_script( 'my-javascript', 'my_js_code.js', false );
}
call action hook:
add_action( 'my_action_hook', 'my_action_function' );

Example of filter hook :

Define filter function :

function my_filter_function($code) {
  $code.='Your code edited';
  return $code;
}
call filter function :
add_filter( 'my_filter_hook', 'my_filter_function' );

Now how to display all hooks that run on current wordpress page

$debug= array();
add_action( 'all', function ( $tags ) {
    global $debug;
    if ( in_array( $tags, $debug ) ) {
        return;
    }
    echo $tags ;
    $debug[] = $tags;
} );






About the author

Joydeb Choudhury holds a Master's degree in Computer Application from I.G.N.O.U. After working as a web developer in various companies he has started bloging in 2016.

Recent Posts of blog

Downalod Free Php Scripts