origgami / CMB2-grid

A grid system for Wordpress CMB2 library that allows columns creation
88 stars 21 forks source link

Missing class_exist #2

Closed Mte90 closed 9 years ago

Mte90 commented 9 years ago

Is possible add in Cmb2GridPlugin a check for class_exist? If two plugin load the same class there is an error.

I've patched with this code

if ( ! class_exists( 'Cmb2Grid\Cmb2GridPlugin' ) ) 
{
///the class code with the initialization
}
pablo-sg-pacheco commented 9 years ago

Are you talking about possible conflicts with other classes? I am using namespace like this: new \Cmb2Grid\Grid\Cmb2Grid();

So i think it's hard to see any conflicts. Don't you think? Or it's another thing you are talking about?

Mte90 commented 9 years ago

I'm working on two plugins that use this library that is in bundle in every plugin. With this little check i resolve the error.

pablo-sg-pacheco commented 9 years ago

Are you saying you are using my plugin to make another plugin? I'm glad to hear that! Never thought it would be used like this.

Ok I'll change that

Mte90 commented 9 years ago

Yes :-) https://github.com/Mte90/WordPress-Plugin-Boilerplate-Powered I've integrated in my boilerplate :-)

pablo-sg-pacheco commented 9 years ago

Great work! I'm going to take a better look when i have time :) And I am so happy to see CMB2 and CMB2-grid there

The class_exist you asked me is done. Test to see if it is ok now