jcchavezs / cmb2-conditionals

Plugin to relate fields in a CMB2 metabox
GNU General Public License v2.0
86 stars 61 forks source link

Modify javascript enqueue #58

Open MattPurland opened 6 years ago

MattPurland commented 6 years ago

Modify javascript enqueue to allow cmb2-conditionals to be included as a library as well as a plugin

jrfnl commented 6 years ago

This shouldn't have any effect at all. It doesn't change when the library is included, just the path to the actual files.

MattPurland commented 6 years ago

That was the aim, sorry if I wasn't very clear.

The modification allows cmb2-conditionals (in its entirety) to be manually included in a theme, as well as being installed as a plugin, like so:

require_once dirname(__FILE__) . '/library/cmb2-conditionals/cmb2-conditionals.php'; cmb2_conditionals_init();

jrfnl commented 6 years ago

@MattPurland In that case, I'm still not sure this is the best way to do it. Also: code should comply with the coding standards & you can't use __DIR__ as the minimum supported PHP version for this plugin in PHP 5.2.