Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to add an instruction into a custom term meta-box. enter image description here

Is there a hook to add this or is it easiest just to use JavaScript?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I couldn't find a hook so I went with the JS option.

add_action( "admin_head-post-new.php", 'meta_box_instruction' ); //new post
add_action( "admin_head-post.php", 'meta_box_instruction' );    //edit post
function meta_box_instruction($d) { 
global $post;

    if($post->post_type == '{YOUR POST TYPE}' || $_GET['post_type'] == '{YOUR POST TYPE}'):
    ?>

    <script type='text/javascript'>
        jQuery(document).ready(function(){
            jQuery('<p>Some instruction</p>').insertBefore('#taxonomy-{YOUR TAXONOMY NAME}').parent();
        });
    </script>

    <?php
    endif;
}
share|improve this answer
1  
I too went through the files to find a filter/action, but couldn't find one. It seems like this is the only option! –  Rutwick Gangurde Nov 7 '11 at 3:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.