Custom Fields
Re-Envisioned
Support Meta Box Group How to use wp_insert_post with cloneable field group

  • Creator
    Topic
  • #32267
    Resolved luigi gaudino
    Participant

    Hi,
    i'm using wp_insert_post with metabox field correctly, but i'm not sure about i have to use wp_insert_post with cloneable field group.

    Can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #32268
    luigi gaudino
    Participant

    Sorry resolved by myself

    #32272
    Long Nguyen
    Moderator

    It would be highly appreciated if you share the solution in your case.

    Thanks.

    #32281
    luigi gaudino
    Participant

    Hi Long, this is my snippet:

    
    wp_insert_post( $postarr=array(
                    
    //'ID' => 0,
    //'post_author'   => ,
    //'post_date' => ,
    //'post_date_gmt' => ,
    //'post_content' => ,
    //'post_content_filtered'=> '',
    'post_title' => 'Contatti',
    //'post_excerpt' => '',
    'post_status' => 'Publish',
    'post_type' => 'forms',
    //'comment_status' => '',
    //'ping_status'   => '',
    //'post_name' => '',
    //'to_ping' => '',
    //'pinged' => '',
    //'post_modified' => '',
    //'post_modified_gmt' => '',
    //'post_parent'   => '',
    //'menu_order'    => '',
    //'post_mime_type' => '',
    //'guid' => '',
    //'import_id' => '',
    //'post_category' => '',
    //'tags_input' => '',
    //'tax_input' => '',
    'meta_input' =>[
      'form_action'   => '#form-Contatti',
      'form_method'   =>  'POST',
      'form_value'    => 'INVIA',
      'form_campo' => [ //group ID
        [ 'form_campo_nome'=>'nome', 'form_campo_tipo'=>'text', 'form_campo_label'=>'Nome', 'form_campo_placeholder'=>'Inserisci il tuo nome' ],
        [ 'form_campo_nome'=>'email', 'form_campo_tipo'=>'email', 'form_campo_label'=>'Email', 'form_campo_placeholder'=>'Inserisci la tua email' ],
        [ 'form_campo_nome'=>'messaggio', 'form_campo_tipo'=>'textarea', 'form_campo_rows'=>'4', 'form_campo_cols'=>'50', 'form_campo_label'=>'Messaggio', 'form_campo_placeholder'=>'Inserisci il tuo messaggio' ]
      ]
                        
    ]
                    
    ), $wp_error=false, $fire_after_hooks=true );
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.