Home Forums Plugin Support WP User Frontend Pro Repeat Field Problem

This topic is: resolved

This topic contains 23 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 10 months ago.

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #2795

    Tareq Hasan
    Keymaster
    Post count: 2831

    Seems like there is a fatal error in that page. Does the contact page includes reCaptcha? Might be a possibility of conflict.

    #2805

    NudeWeb
    Participant
    Post count: 11

    Yes the page has reCaptcha. How can I solve this conflict. 

    #2806

    Tareq Hasan
    Keymaster
    Post count: 2831

    The contact page template in Avada has this code
    [php]
    if($data[‘recaptcha_public'] && $data[‘recaptcha_private']) {
    require_once(‘framework/recaptchalib.php');
    }
    [/php]

    Remove this code from that page.

    #2816

    NudeWeb
    Participant
    Post count: 11

    Thank you. The contacts page is OK now. I added the code below to functions.php but I don't see the custom field in edit forms.

    function wpufe_insert_recipe( $post_id ) {
        if ( isset( $_POST['recipe'] ) ) {
            $items = get_post_meta( $post_id'recipe' );
            $ingredients array();
            if $items ) {
                foreach ($items as $key => $item) {
                    $values explode'| '$item );
                    $ingredients[] = array(
                        'quantity' => $values[0],
                        'notes' => $values[1]
                    );
                }
            }
            update_post_meta( $post_id'_recipe_ingredient_value'$ingredients );
        }
    }
    add_action( 'wpuf_add_post_after_insert''wpufe_insert_recipe' );

     

     

    #2818

    Tareq Hasan
    Keymaster
    Post count: 2831

    The code is not for showing custom fields in the form. Read here again. It's a hack to transform the multicolumn repeatable fields value to the recipe format of that plugin.

    #2821

    NudeWeb
    Participant
    Post count: 11

    Please give a little more detail how to do this. I am lost how to do it.

    #2823

    Tareq Hasan
    Keymaster
    Post count: 2831

    You need to add repeat field in the form editor like this:

    repeatable fields

    Now that code will now for this field.

    #2829

    NudeWeb
    Participant
    Post count: 11

    Thank you. I have done as you said but the function does not add to the ingredients it only adds test to the end of post.

    #2841

    Tareq Hasan
    Keymaster
    Post count: 2831

    I gave you example code that how you should proceed. I can't give you full integration help right now.

Viewing 9 posts - 16 through 24 (of 24 total)

The topic ‘Repeat Field Problem’ is closed to new replies.