Title: CMB2 PHP class?
Last modified: August 31, 2016

---

# CMB2 PHP class?

 *  Resolved [Mohammed N.](https://wordpress.org/support/users/nomans_beauty/)
 * (@nomans_beauty)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/)
 * Hi,
 * Great work on this. Is there a PHP class that can be used or included in a WordPress
   plugin which can then be used to create metaboxes for the plugin features? So
   that we don’t need to force user to install separate WP CMB 2 plugin. Please 
   let me know.
 * Thanks
 * [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)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105294)
 * You can bundle the entire CMB2 package as a library within your plugin (or theme).
   It was built to work this way primarily. It’s also built in such a way that it
   will handle only running one instance of CMB2, and only the instance that is 
   the most current.
 *  Thread Starter [Mohammed N.](https://wordpress.org/support/users/nomans_beauty/)
 * (@nomans_beauty)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105330)
 * Thanks for prompt response. Is there a special documentation or usage instructions
   to include as library? Also this way will hide CMB2 from the installed plugins
   section of WordPress, correct?
 * Thanks.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105362)
 * The example-functions.php file should have some documented examples for how to
   include as a library in your own plugin. Essentially with the wordpress.org plugin
   here, we did the exact same thing so that users don’t have to include the necessary
   files themselves.
 * Yes, it should remain hidden from the plugin list when you have it inside your
   own plugin folder. It won’t be listed and activateable directly.
 *  Thread Starter [Mohammed N.](https://wordpress.org/support/users/nomans_beauty/)
 * (@nomans_beauty)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105377)
 * ok thats good, Thanks.
 *  [GS Plugins](https://wordpress.org/support/users/samdani/)
 * (@samdani)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105553)
 * Hi,
    Recently I developed a plugin & bundled the entire CMB2 package as a library
   within my plugin but got this message from plugin review team. Can you please
   check this?
 * Is there any CMB2 class which I can extends and use at my plugin?
 * [https://wordpress.org/support/topic/how-to-use-cmb2-inside-new-plugins](https://wordpress.org/support/topic/how-to-use-cmb2-inside-new-plugins)
 * Waiting for your response.
 * Thanks
 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105556)
 * I responded on your thread, samdani, but posting here as well:
 * This rejection/reasoning is completely new to me, and is something we will have
   to look into accounting for in the future. For more background, I have written
   this post: [http://j.ustin.co/1oM7zL7](http://j.ustin.co/1oM7zL7)
 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105557)
 * Please see plugin team’s response here: [https://wordpress.org/support/topic/how-to-use-cmb2-inside-new-plugins?replies=4#post-8097931](https://wordpress.org/support/topic/how-to-use-cmb2-inside-new-plugins?replies=4#post-8097931)
 * > Don’t include plugins in plugins. You can use tgm or you can check if is-plugin-
   > active, but you can’t include a plugin in a plugin.

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

The topic ‘CMB2 PHP class?’ 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/)

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)

 * 7 replies
 * 4 participants
 * Last reply from: [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/cmb2-php-class/#post-7105557)
 * Status: resolved