WordPress.org

Ready to get started?Download WordPress

Forums

new post id (2 posts)

  1. sefran
    Member
    Posted 5 years ago #

    Hi.
    In a plugin, I've added the action
    add_action ('post-new.php', 'set_custom_fields_for_new_posts');
    so when the user tries to create a new post, I add it some custom fields.
    The problem is that the function add_post_meta takes the post_id parameter and a new post has no id before saving it.
    Any suggestion?

  2. kirathang
    Member
    Posted 4 years ago #

    i have the same problem !
    please any suggestion

Topic Closed

This topic has been closed to new replies.

About this Topic