Contributing to CMB2
Thank you for your interest in contributing back to CMB2. Please help us review your issues and/or merge your pull requests by following the below guidelines.
NOTE: The issues section is for bug reports and feature requests only.
Before reporting a bug
- Please review the documentation. Most questions revolve around the field types, field parameters, or are addressed in the troubleshooting section.
- Search issues to see if the issue has been previously reported.
- Install the
developversion of CMB2 and test there.
How to report a bug
- Specify the version number for both WordPress and CMB2.
- Describe the problem in detail. Explain what happened, and what you expected would happen.
- Provide a small test-case and a link to a gist containing your entire metabox registration code.
- If helpful, include a screenshot. Annotate the screenshot for clarity.
How to contribute to CMB2
All contributions welcome. If you would like to submit a pull request, please follow the steps below.
- Make sure you have a GitHub account.
- Fork the repository on GitHub.
- Check out the
developversion of CMB2. If you submit to the master branch, the PR will be closed with a link back to this document.
- Verify your issue still exists in the
- Make changes to your clone of the repository.
- Please follow the WordPress code standards.
- If possible, and if applicable, please also add/update unit tests for your changes.
- Please add documentation to any new functions, methods, actions and filters.
- When committing, reference your issue (if present) and include a note about the fix.
- Submit a pull request.
Note: You may gain more ground and avoid unecessary effort if you first open an issue with the proposed changes, but this step is not necessary.
If you are looking to provide language translation files, Please do so via WordPress Plugin Translations.
We use PHPUnit and the WordPress test suite for our unit/integration tests.
- You can install the WordPress test suite using the installer:
bash tests/bin/install-wp-tests.sh wordpress_test root ''. (this will install the test suite in the temp folder on your computer, using a test database with those given credentials)
- Install PHPUnit via composer,
- Once Composer and the WordPress test sutie are installed, you can run phpunit via
./vendor/bin/phpunitin the CMB2 directory.