• I am creating an interface to add/update posts from within my theme. I POST the form to the same page that uses wp_insert_post(); in order to add it to the database and right after that uses add_post_meta(); to add custom field.

    I need to know post ID, hoeever, in order to run add_post_meta();, which I do not know. I have looked through Google and Codex, but did not find an answer.

    Please advise me how to find out ID of the post that I have just added (a certain way) or any other way to do what I want to.

Viewing 1 replies (of 1 total)
  • Thread Starter nigmatech

    (@nigmatech)

    Please let me know if the question is not formulated well, I am new to WordPress coding and PHP

Viewing 1 replies (of 1 total)
  • The topic ‘Get Post Id While Adding it to the database.’ is closed to new replies.