Bundling Meta Box
Meta Box and extensions can be used as standalone plugins or bundled within other themes or plugins.
- If you want to bundle Meta Box into other products or services (plugins, themes, solutions, hosting providers, SASS companies, site maintenance providers, etc.) that sell to other people, please contact us for a custom pricing plan.
- You are not allowed to use premium extensions in your free products, like plugins and themes on WordPress.org.
Using TGM Plugin Activation
It's recommended to use the TGM Plugin Activation to declare Meta Box and free extensions as dependencies for your themes or plugins. This way, Meta Box and the extensions can be auto-updated to the latest version.
To use the, follow these steps:
- Download TGMPA Plugin Activation. For I'm going to use TGMPA in a: select Plugin.
- Extract the downloaded
.zip
file and copy the fileclass-tgm-plugin-activation.php
andexample.php
to your theme/plugin folder. - Open the
example.php
file and add Meta Box to the required plugin list:
require_once __DIR__ . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'prefix_register_required_plugins' );
function prefix_register_required_plugins() {
$plugins = [
[
'name' => 'Meta Box',
'slug' => 'meta-box',
'required' => true,
],
];
$config = [
'id' => 'your-id',
];
tgmpa( $plugins, $config );
}
Then, include the example.php
file in your theme's functions.php
or your plugin's main file.
Directly including extensions
This method disables the auto update mechanism and sometimes causes conflicts with the latest versions of WordPress, or with other plugins that use other versions of Meta Box and extensions. And you have to update extensions manually. You should consider using TGMPA Activation class as described above first, and only use this method if you don't have another choice.
Bundling extensions is that you include extensions directly in your products and use them as a library.
- Copy the extension folder to your theme or plugin. You can put it in the theme root folder or a subfolder.
- Include the extension's main file in the
functions.php
of your theme or your plugin's file:
require get_template_directory() . '/mb-settings-page/mb-settings-page.php';