Dev Docs
  • Disciple.Tools Technical Documentation
  • Theme Core
    • API - Posts
      • List of Endpoints
      • Fields Format
      • Get Post
      • Create Post
      • Update Post
      • Post Comments
      • Post Activity
      • List Query
      • Global Search
      • Posts in Typeaheads
      • Post-Sharing
      • Get Following
      • Settings
    • API - Other
      • Users
      • Locations
      • Settings
    • Hooks
      • Record Page Hooks
      • API-Hooks
      • Public settings
      • Adding menu navigation links
    • Customization
      • Fields
      • Custom Post Types
      • Post Type Modules
      • Adding Fields and Tiles.
    • Authentication
      • JWT-Authentication-for-the-mobile-app
      • Site-to-Site-Link
      • Easy-Example
    • Permissions
    • Roles and Permissions
    • Database Tables
      • Activity Table
    • Disciple.Tools Translation
    • Revisions
      • v1.0.0-dev-changes
      • v1.0
  • Hosting
    • 404 Errors on new install
    • CRON
    • Hosting on WPEngine
    • Backups
    • Single Site or MultiSite
  • Disciple.Tools Development Setup
    • LocalWP
    • Mobile App Setup
    • Unit Tests
    • Cypress Tests
    • D.T on Docker Setup
    • Gulp - CSS and JS
  • Code Contribution
    • Theme Contribution Guidelines
    • How to Correctly Contribute to the Disciple Tools Repository
    • How to Translate Your Plugin
  • Style Guide
  • Disciple.Tools Code of Conduct
Powered by GitBook
On this page
  • How to Contribute to the theme
  • Setup for Develope
  • Install Composer
  • Install NPM dependencies
  • Translations
  • PHPCS
  • Missing WP functions errors
  • PHPCS sniff errors
  • GitHub and Commits
  • WP_DEBUG

Was this helpful?

Edit on Git
  1. Code Contribution

Theme Contribution Guidelines

PreviousCode ContributionNextHow to Correctly Contribute to the Disciple Tools Repository

Last updated 3 months ago

Was this helpful?

Thank you for joining us in contributing to Disciple.Tools! These are the guidelines we expect you to follow in writing code that will be used in or with D.T

How to Contribute to the theme

Follow these steps.

  1. Fork it!

  2. Create your feature branch: git checkout -b my-new-feature

  3. Commit your changes: git commit -am 'Add some feature'

  4. Push to the branch: git push origin my-new-feature

  5. Submit a pull request

Setup for Develope

Install Composer

Download and install composer via or via Homebrew:

$ brew update
$ brew install composer

Install o Run Composer to install dependencies

$ composer install

Install NPM dependencies

$ npm install

Translations

D.T is already being used in multiple languages. Please help us make D.T translable by taking full advantage of Wordpress’ translatable strings. Any string that will be read by the user must be marked as translatable. Ex: <label class="section-header"><?php esc_html_e( 'Other', 'disciple_tools' )?></label>

Make sure you look for these in PHP, HTML and JavaScript code.

PHPCS

Run composer install or composer update first.

In the theme you can run ./tests/test_phpcs.sh or create a pull request to our repo and Travis CI will run the tests for you.

If you are working on a plugin based off our starter plugin run ./includes/admin/test/test_phpcs.sh

Run phpcbf to auto-fix some phpcs issues: vendor/bin/phpcbf --standard="phpcs.xml" dt-core/

Missing WP functions errors

If all of the WP functions are showing up as errors saying that the function is undefined, you can try adding the entire WP site to your editor, so that it can automatically pick up the WP function definitions from wp-include, wp-admin etc.

PHPCS sniff errors

If you get errors such as, phpcs Referenced sniff "WordPress" does not exist this could be due to your editor not using the correct phpcs or phpcs.xml file. It could be using a globally installed version instead.

Make sure that you point your editor to the local phpcs file in vendor/bin/phpcs and phpcs config file phpcs.xml in the disciple-tools-theme directory.

In vscode the settings look roughly like this, depending on your setup and where the settings are being kept. In this example a directory specific settings.json file is being used in the root of the website. The paths, may need to be the full absolute paths or relative paths to where the settings file is.

    "phpcs.executablePath": "wp-content/themes/disciple-tools-theme/vendor/bin/phpcs",
    "phpcs.standard": "wp-content/themes/disciple-tools-theme/phpcs.xml"

GitHub and Commits

To commit to the theme or an existing plugin start by creating a fork of the repository. When you are ready, create a pull request into our repo.

Note: Depending on your context you may wish to use an anonymous GitHub account.

WP_DEBUG

Enable WP_DEBUG in your wp-config.php: define('WP_DEBUG', true); Checking out a PR and seeing the orange debug table is disappointing.

We look forward to hearing from you!

We use and to test for syntax errors, security vulnerabilities and some styling rules. We expect your commits to pass these tests.

Note: rules for PHPCS are located in the phpcs.xml file. We sometimes update the rule list as PHPCS updates. We’ll update the phpcs.xml, you might want to look there to get the latest version.

For new plugins copy our .

their instructions
PHPCS
PHPCS WordPress Coding Standards
starter plugin
starter plugin