Skip to main content
Updated question lingo
Source Link
Howdy_McGee
  • 20.8k
  • 24
  • 91
  • 175

i'veI have a problem on Wordpress Hookwith a WordPress hook. I want to call an action in an other actionanother actions callback, but it doesn't seem to work. I want to call add_meta_tagadd_meta_tag action only if the page is saved. This is what i've doneI have:

add_action('post_submitbox_start', 'createCustomField');

function saveCustomField($post_id)
{
    add_action( 'wp_head', 'add_meta_tag' );
}
 
add_action( 'save_post', 'saveCustomField' );

function add_meta_tag(){
    echo "TEST";
}

Thanks for reply.How can I get the above to work properly?

i've a problem on Wordpress Hook. I want to call an action in an other action but it doesn't work. I want to call add_meta_tag action only if page is saved. This is what i've done:

add_action('post_submitbox_start', 'createCustomField');

function saveCustomField($post_id)
{
    add_action( 'wp_head', 'add_meta_tag' );
}
 
add_action( 'save_post', 'saveCustomField' );

function add_meta_tag(){
    echo "TEST";
}

Thanks for reply.

I have a problem with a WordPress hook. I want to call an action in another actions callback, but it doesn't seem to work. I want to call add_meta_tag action only if the page is saved. This is what I have:

function saveCustomField($post_id)
{
    add_action( 'wp_head', 'add_meta_tag' );
}
add_action( 'save_post', 'saveCustomField' );

function add_meta_tag(){
    echo "TEST";
}

How can I get the above to work properly?

Source Link

Call add_action() in function wordpress

i've a problem on Wordpress Hook. I want to call an action in an other action but it doesn't work. I want to call add_meta_tag action only if page is saved. This is what i've done:

add_action('post_submitbox_start', 'createCustomField');

function saveCustomField($post_id)
{
    add_action( 'wp_head', 'add_meta_tag' );
}

add_action( 'save_post', 'saveCustomField' );

function add_meta_tag(){
    echo "TEST";
}

Thanks for reply.