Support » Plugins » Trying to capture post_id

  • acend


    I’m currently writing a plugin that will take some entry data, add it to a table in the database (wp_bdc_pages) and the using the $_POST data from the form creates a page. So far everything works perfect, can create new entries, it creates the pages, and I can update previous entries and it will update the data successfully in the database table but it does not change the info from the already created page (since I am using $_POST).

    Instead of running server side php/sql queries to pull up the information every page load, is there a way when I initially create the page using wp_insert_post() to capture the post_id for the newly created page?

    My thinking is if I can capture that and add it as an element in the wp_bdc_pages table I can then use another function and wp_insert_post() when I want to make edits but just calling the post id.

    If anyone has any ideas or thoughts or questions I’d be most appreciative.

    [ Please don’t bump. ]

  • The topic ‘Trying to capture post_id’ is closed to new replies.