Tagged: add_more, nested group
- This topic has 1 reply, 2 voices, and was last updated 1 year, 10 months ago by
Steve.
Viewing 1 reply thread
-
AuthorPosts
-
-
March 26, 2020 at 1:26 am #9564
Md Rashed HossainParticipantI used this code for the nested group with add_more, now how can I show the output. My code
<?php /** * Title: Section * Post Type: doc **/ piklist( 'field', array( 'type' => 'group', 'field' => 'tdoc_section', 'label' => __( 'Section', 'tdoc' ), 'add_more' => true, 'fields' => array( array( 'type' => 'text', 'field' => 'title', 'label' => __( 'Section Title', 'tdoc' ), 'attributes' => array( 'class' => 'widefat' ) ), array( 'type' => 'editor', 'field' => 'description', 'label' => __( 'Section Description', 'tdoc' ), 'template' => 'field', 'options' => array( 'wpautop' => true, 'media_buttons' => true, 'shortcode_buttons' => true, 'teeny' => true, 'dfw' => true, 'quicktags' => true, 'drag_drop_upload' => true, 'tinymce' => array( 'resize' => true, 'wp_autoresize_on' => true ) ) ), array( 'type' => 'group', 'field' => 'tdoc_section_group', 'label' => __( 'Sub Section', 'tdoc' ), 'add_more' => true, 'fields' => array( array( 'type' => 'text', 'field' => 'sub_title', 'label' => __( 'Section Title', 'tdoc' ), 'attributes' => array( 'class' => 'widefat' ) ), array( 'type' => 'editor', 'field' => 'sub_description', 'label' => __( 'Section Description', 'tdoc' ), 'template' => 'field', 'options' => array( 'wpautop' => true, 'media_buttons' => true, 'shortcode_buttons' => true, 'teeny' => true, 'dfw' => true, 'quicktags' => true, 'drag_drop_upload' => true, 'tinymce' => array( 'resize' => true, 'wp_autoresize_on' => true ) ) ) ) ) ) )); -
March 31, 2020 at 9:32 am #10607
SteveKeymasterWelcome to the Piklist community!
By assigning a
fieldto agroup, the data is saved as an array totdoc_section. So, to retrieve the data use:get_post_meta($post->ID, 'tdoc_section')You can then loop through the data.
-
-
AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.