Home Forums Plugin Support WP User Frontend Pro Action Hook only on new post page

This topic is: resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Tareq Hasan 6 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3697

    noomia
    Participant
    Post count: 115

    Hi Tareq !

    I have a simple question : I have an action hook and I want it to be called only on the new post page, not on the edit post page. How can I do that ?

    #3717

    Tareq Hasan
    Keymaster
    Post count: 2831

    The post ID is the second parameter, for new posts, it's null. For edit posts, it's the post id of the edited post. So check if it's null and only then show your element.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Action Hook only on new post page’ is closed to new replies.