Title: type=&gt;group, add_button=&gt;false
Last modified: August 22, 2016

---

# type=>group, add_button=>false

 *  Resolved [John_G](https://wordpress.org/support/users/john_g/)
 * (@john_g)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/)
 * Why group field can’t be not repeatable?
    Who needs true group field have to 
   fix CMB2.php:
 *     ```
       CMB2.php
       function render_group($args)
       ```
   
 * Wrap the echoing of a button inside such if:
 *     ```
       if($field_group->options('add_button')){
         echo '<div class="cmb-row"><div class="cmb-td"><p class="cmb-add-row">...
       }
       ```
   
 * then use
 *     ```
       'add_button' => false
       ```
   
 * for field options.
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5911698)
 * If you want a group that’s not repeatable, than it’s likely you want a separate
   metabox. Can you explain why you would need a non-repeatable group? If it’s to
   differentiate a section, you could use the `title` field type to separate them.
 *  Thread Starter [John_G](https://wordpress.org/support/users/john_g/)
 * (@john_g)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5911718)
 * It does not matter if it is separate metabox or not. The design of the plugin
   does not allow to save **group**(if not using _type=>group_) as a single meta
   entry. Everything results in a mess of metas. One have to deal with multiple 
   _get\_post\_meta_ instead of retrieving all the corresponding data in one go.
 * You should not overthink anything. **Group** filed is a group firstly. **Repeatable**
   is different story.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 2 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5911769)
 * you can get all of the post meta on a post with 1 `get_post_meta()` call, for
   what it’s worth, but it fetches EVERYTHING and you’d need to filter out what 
   you don’t need. Just provide the ID of the post and nothing else.
 *  Thread Starter [John_G](https://wordpress.org/support/users/john_g/)
 * (@john_g)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5911795)
 * Consider such scenario: you need to combine JSON for client side. With single`
   get_post_meta` you will have to filter metas by hand and repeat keys (`keys for
   filtering = cmb2 metabox field ids`):
 *     ```
       $metas = get_post_meta($id);
       $keys = array_keys($keys_i_need);
       $filtered = array();
       foreach ($metas as $key => $value)
       {
         if (in_array($key, $keys))
         {
           $filtered[$key] = $value;
         }
       }
       ```
   
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5912008)
 * Ever find a workable solution for this John_G?
 *  Thread Starter [John_G](https://wordpress.org/support/users/john_g/)
 * (@john_g)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5912009)
 * [Piklist](https://wordpress.org/plugins/piklist/)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 9 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5912010)
 * Good to know you found something to work. Have a good day.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘type=>group, add_button=>false’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/typegroup-add_buttonfalse/#post-5912010)
 * Status: resolved