Skip to main content
1 of 2

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.