wordpress pulgin custom hook

pulgin custom hook Or call function defined in function.php from plugin

in plugin:

add_action('after_setup_theme',function(){

    if(function_exists('the_action_callback')) {
        do_action('the_action_hook');
    }

});

———


function.php

add_action('the_action_hook', 'the_action_callback');

function the_action_callback() {

    echo '<p>Hi I am from function.php</p>';

}

 

Author: bm on August 8, 2014
Category: wordpress

Your comment:

Your Name

Comment:




Last articles