I have a plugin adding a custom meta box to the comments editing page:

function on_admin_init() {
__( 'Voto recensione', FB_DT_TEXTDOMAIN ),
array( &$this, 'meta_box_voto' ),
'comment', 'normal', 'high'
function meta_box_voto($data) {
jQuery(document).ready(function() {     
} ...

But the alert is called twice! Is this a WP or jQuery bug? Am I making any mistake?


P.S. If I put the alert into the first function it is only called once...

1 Answer 1


Put the JS in the admin_footer. If the Widgets are moved, your JS tag code can be duplicated hence called twice.

  • Great, I love you!
    – teocomi
    Nov 1, 2011 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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