'default_state' => 'collapsed', not collapsing group on load
- This topic has 1 reply, 2 voices, and was last updated 6 years, 11 months ago by
Anh Tran.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
June 1, 2018 at 2:28 PM #9969
makeagency
ParticipantThe group remains open after initial page load.
I have the follwing metabox extensions installed:
MB Admin Columns
MB Revision
MB Term Meta
MB Group
MB Conditional Logic
MB Include Exclude
MB Show Hide
Meta Box Updater$meta_boxes[] = array( 'id' => 'C_hotel_previews', 'title' => '<img src="'.get_template_directory_uri().'/assets/metabox/img/cpt-hotel-preview.png">', 'post_types' => array( 'hotels' ), 'autosave' => false, 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Hotel Previews', 'type' => "heading", 'desc' => 'Add an area and include it\'s corresponding images with descriptions.', ), // GROUP array( 'id' => 'hotel_area_group', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'collapsible' => true, 'default_state' => 'collapsed', 'group_title' => array( 'field' => "{$prefix}area_title" ), 'add_button' => '+ Area', 'fields' => array( // TEXT array( 'name' => 'Area Title', 'id' => "{$prefix}area_title", 'type' => 'text', 'label_description' => 'Rooms, Swimming Pool, Restaurant, etc...', ), // GROUP array( 'id' => 'slide_group', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'collapsible' => true, 'default_state' => 'collapsed', 'save_state' => true, 'group_title' => 'Slide {#}', 'add_button' => '+ Slide', 'fields' => array( // IMAGE array( 'name' => 'Image', 'id' => "{$prefix}slide_group_image", 'type' => 'image_advanced', 'force_delete' => false, 'max_file_uploads' => 1, 'max_status' => true, ), // WYSIWYG/RICH TEXT EDITOR array( 'name' => 'Description', 'id' => "{$prefix}slide_group_wysiwyg", 'type' => 'wysiwyg', 'raw' => false, 'options' => array( 'textarea_rows' => 3, 'teeny' => true, 'media_buttons' => false, ), ), ), ), // end Group ), ), // end Group ), );
June 5, 2018 at 9:56 PM #10059Anh Tran
KeymasterHello, I've just tried your code and it works. Did you see any error in the console?
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.