sort_clone is not working at some points
- This topic has 5 replies, 2 voices, and was last updated 7 years, 5 months ago by
Anh Tran.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
November 27, 2017 at 2:12 AM #7609
nfyp145
ParticipantHi Tan
I use group type when creating arrays. It's much easier to read and call arrays. Below is my sample code for post meta box.
<?php add_filter('rwmb_meta_boxes', 'my_post_meta_box'); function my_post_meta_box($meta_boxes) { $prefix = ''; $meta_boxes[] = array( 'id' => 'my_post_meta_box_array', 'post_types' => 'post', 'tab_style' => 'left', 'tabs' => array( 'tab_1' => 'Custom Post', 'tab_2' => 'Related Post', ), 'title' => 'My Post Meta Box', 'fields' => array( /* // CUSTOM POST -------------------------------------------------- */ array( 'id' => 'custom_post', 'tab' => 'tab_1', 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), ), ), /* // RELATED POST -------------------------------------------------- */ array( 'id' => 'related_post', 'tab' => 'tab_2', 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), array( 'clone' => true, 'collapsible' => true, 'id' => 'group', 'sort_clone' => true, 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), array( 'id' => 'url', 'name' => 'URL', 'type' => 'url', ), ), ), ), ), ), ); return $meta_boxes; }
At there, sort_clone from "RELATED POST" is not working. Probably, Javascript error?
But when I put "RELATED POST" code at the top... like below... sort_clone is working.
<?php add_filter('rwmb_meta_boxes', 'my_post_meta_box'); function my_post_meta_box($meta_boxes) { $prefix = ''; $meta_boxes[] = array( 'id' => 'my_post_meta_box_array', 'post_types' => 'post', 'tab_style' => 'left', 'tabs' => array( 'tab_1' => 'Custom Post', 'tab_2' => 'Related Post', ), 'title' => 'My Post Meta Box', 'fields' => array( /* // RELATED POST -------------------------------------------------- */ array( 'id' => 'related_post', 'tab' => 'tab_2', 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), array( 'clone' => true, 'collapsible' => true, 'id' => 'group', 'sort_clone' => true, 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), array( 'id' => 'url', 'name' => 'URL', 'type' => 'url', ), ), ), ), ), /* // CUSTOM POST -------------------------------------------------- */ array( 'id' => 'custom_post', 'tab' => 'tab_1', 'type' => 'group', 'fields' => array( array( 'id' => 'title', 'name' => 'Title', 'type' => 'text', ), array( 'id' => 'description', 'name' => 'Description', 'type' => 'textarea', ), ), ), ), ); return $meta_boxes; }
Could you please help me with that issue?
Thank you so much Tan!
November 27, 2017 at 11:14 AM #7620Anh Tran
KeymasterThanks, I will check it now.
November 27, 2017 at 11:46 AM #7622nfyp145
ParticipantAppreciate for the reply Tan.
Eagerly Waiting...
December 6, 2017 at 5:38 PM #7771Anh Tran
KeymasterI've found the bug and fixed it in version 1.2.12 of Group extension. Please update.
December 8, 2017 at 2:03 AM #7785nfyp145
ParticipantSorry for late confrim.
It works well now. Thank you so much and appreciate for the fix.
Happy Holidays Tan!
December 8, 2017 at 8:51 AM #7787Anh Tran
KeymasterGreat! Happy holidays 🙂
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The topic ‘sort_clone is not working at some points’ is closed to new replies.