Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.59 KB

CONTRIBUTING.md

File metadata and controls

42 lines (34 loc) · 1.59 KB

Development environment

This setup is only meant for development use - for production follow Quickstart instead.

  1. Setup a blank WordPress installation
  2. Add a new carbon-fields directory inside your theme of choice and switch to it
    1. Fork this repository and clone your fork
    2. Run git checkout development
    3. Run composer install
    4. Run npm install or yarn install
    5. Run npm run build or yarn run build
  3. 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();
    }

Preparation

  1. Make sure your local branches are up to date
  2. Always start your contribution branches from the development branch
  3. If you are making JavaScript contributions, run npm run start or yarn start to run the dev build task (tracks file changes)

Pull Request Process

  1. Target the development branch for pull requests
  2. Include a detailed description of your contribution
  3. Make sure you follow the current codestyle