Is there a filter/action to add content to WP admin metaboxes?

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;
}

Leave a Comment