Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

Skip to main content

Composer

This docs shows you how to use Composer to install and update Meta Box and its extensions.

Licensing
  1. If you want to bundle premium extensions 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.
  2. You are not allowed to use premium extensions in your free products, like plugins and themes on WordPress.org.

Meta Box and free extensions

Meta Box and all free extensions are available on Packagist.

To use them in your project, simply run:

composer require wpmetabox/meta-box // For Meta Box
composer require wpmetabox/mb-rest-api // For MB Rest API

composer require wpmetabox/meta-box-lite // Or use Meta Box Lite, which includes Meta Box and all free extensions

Premium extensions

To use Composer to install paid extensions, add repositories rule to your composer.json:

"repositories":[
{
"type": "composer",
"url": "https://packages.metabox.io/YOUR_LICENSE_KEY"
}
],

Then you can install paid extensions with:

composer require meta-box/mb-settings-page:dev-master
composer require meta-box/meta-box-group:dev-master

Notes:

  • The version of premium extensions specified in composer.json must be dev-master. We don't support version constraints for premium extensions yet. You always use the latest version.
  • Extensions are not autoloaded by default. You can manually load them or autoload by adding extensions' main files to the autoload array in composer.json.
  • Extensions then will be installed in WordPress's wp-content/plugins folder thanks to composer/installers. To move them to the traditional vendor folder, add installer-paths to your composer.json file as follows:
{
"repositories": [
{
"type": "composer",
"url": "https://packages.metabox.io/YOUR_LICENSE_KEY"
}
],
"require": {
"wpmetabox/mb-custom-post-type": "^2.3",
"meta-box/meta-box-group": "dev-master",
"meta-box/mb-settings-page": "dev-master"
},
"extra": {
"installer-paths": {
"vendor/meta-box/{$name}": [
"vendor:wpmetabox",
"vendor:meta-box"
]
},
},
"autoload": {
"files": [
"vendor/wpmetabox/mb-custom-post-type/mb-custom-post-type.php",
"vendor/meta-box/mb-settings-page/mb-settings-page.php",
"vendor/meta-box/meta-box-group/meta-box-group.php"
]
}
}

To make the extensions work, load Composer's autoload file:

require 'vendor/autoload.php';

Now you can start using Meta Box extensions in your products!

Boilerplate

To make it easier for developers, I've created a composer.json file, which contains a full list of extensions, free and premium. You can grab it here and remove the extensions you don't want to use.

Can't update with Composer

Because we use dev-master version, Composer can't load versions to check when running composer update. To fix this, please run the following command:

rm -rf vendor && composer clear-cache && composer install