This setup is only meant for development use - for production follow Quickstart instead.
- Setup a blank WordPress installation
- Add a new
carbon-fields
directory inside your theme of choice and switch to it- Fork this repository and clone your fork
- Run
git checkout development
- Run
composer install
- Run
npm install
oryarn install
- Run
npm run build
oryarn run build
- Add the following code to the top of your functions.php file:
use Carbon_Fields\Container; use Carbon_Fields\Field; add_action( 'carbon_fields_register_fields', 'crb_attach_theme_options' ); function crb_attach_theme_options() { Container::make( 'theme_options', __( 'Theme Options', 'crb' ) ) ->add_fields( array( Field::make( 'text', 'crb_text', 'Text Field' ), ) ); } add_action( 'after_setup_theme', 'crb_load' ); function crb_load() { require_once( 'carbon-fields/vendor/autoload.php' ); \Carbon_Fields\Carbon_Fields::boot(); }
- Make sure your local branches are up to date
- Always start your contribution branches from the
development
branch - If you are making JavaScript contributions, run
npm run start
oryarn start
to run the dev build task (tracks file changes)
- Target the
development
branch for pull requests - Include a detailed description of your contribution
- Make sure you follow the current codestyle