Support

Account

Home Forums General Issues Pass Post ID to prepare_field

Solved

Pass Post ID to prepare_field

  • Need some input from others.

    Background:

    I have a form (edit-this.php) that is used to edit a single-post type.

    And in my field group I have a field that I want to use prepare_field and need to pass the post_id to.

    Trying not to use the post_type-single.php for this post type if I can help it.

    If I use get_the_ID(), it will return the ID of the page.

    Thoughts or ideas?

  • You are correct, I think. In your prepare_field filter you need to get the post ID. What you posted is one method of doing that.

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

The topic ‘Pass Post ID to prepare_field’ is closed to new replies.