• Resolved masterbip

    (@masterbip)


    Hello. I am struggle with this not as simple as it sound, and I have tried a lot of options. I just “simple” need a HIDDEN field inside the form with the POST ID from the context (NOT the form ID)
    I have tested several options with the hidden field, but none works.
    I know there is a [_post_id] to send it with the email. But I need it in the form.
    Can you help me please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    You already have it. The value of the _wpcf7_container_post field is the container post ID.

    Thread Starter masterbip

    (@masterbip)

    Many thanks you helped me a lot. This is the scenario: A CONTACT FORM 7 with Post My CF7 Form to create a custom post. One post meta field is POST ID. So I have created this simple and short function (to whom need it later)

    /* HOOK curso_id cf7 */
    add_filter('cf7_2_post_filter-post-mb_post_curso','filter_post_mb_post_curso',10,3);
    function filter_post_mb_post_curso($value, $post_id, $form_data){
    	$value = $_POST['_wpcf7_container_post'];
    	return $value;
    }

    It worked like a CHARM!!!
    Many thanks !!!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hidden field with POST ID (from context)’ is closed to new replies.