i need to add a custom form on the post-new0.php page of the admin of wordpress. ( this form will load an external script in ajax and fill all the field) I'm able to do it via my plugin with

add_action('admin_print_scripts-post-new.php', 'my_echo_function');

But it print it at the top of the page, how can i do to print it as i show on the image ? ( just above the title post text area). ny idea ? Thank you.

EDIT: it can be before or after th wp form this is where i print it right now:

where its printed


1 Answer 1


WordPress 3.7 has an edit_form_top hook that may be what you need.

add_action('edit_form_top', 'my_echo_function');

Though you will need to write logic to keep it from executing on any but the post-new.php page.

  • It should be outside the wp form, because i'm addming a new <form> Dec 3, 2013 at 14:49
  • I don't think that is going to be easy. Why not work with the form you already have?
    – s_ha_dum
    Dec 3, 2013 at 14:55
  • Because it's different, my form do somethimg all, it post some variable somewhere else Dec 3, 2013 at 15:16
  • But your question mentions AJAX. It doesn't matter if it is the same form or not. Don't use a <form> tag and manipulate everything with Javascript-- kind of like the "custom fields" meta box. In other words, you have decided on a solution that is fighting uphill all the way. Rethink the solution and use what you have available.
    – s_ha_dum
    Dec 3, 2013 at 15:22

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.