heelo,
I want to use this great hook edit_form_after_title
it was announced on December 1, 2012:
http://make.wordpress.org/core/2012/12/01/more-hooks-on-the-edit-screen/
it curreclty hook for :
post-new, post, page-new, page.
how do I make it to work only in edit page/post (only post, page)
thanks all
Personally I’d use a different approach, because @Shazzad‘s solution seems too much global dependent, and @s_ha_dum‘s needs 2 hooks instead of one.
I’d use
get_current_screen
function to get aWP_Screen
object, then I’d look at its property to run (or not) something after the title:Don’t know if there was any change during the time that passed from the original question but as of 4.0 you get the post as a parameter to the hook and all that is needed to do is to check the post type. If you wonder what happens when creating a new post the answer is that WordPress generates a dummy post if the post type set to the correct type.
Check post type using
$typenow
and$pagenow
global variables.