Planet4 GPCH Plugin Blocks
Content Blocks specific to the GPCH install of Planet4
by greenpeace · github.com/greenpeace/planet4-gpch-plugin-blocks · website
★ 2stars
2.7kcomposer installs
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/greenpeace/planet4-gpch-plugin-blocks/archive/refs/heads/master.zipAlso on Packagist as greenpeace/planet4-gpch-plugin-blocks:
composer require greenpeace/planet4-gpch-plugin-blocksFrom the readme
planet4-gpch-plugin-blocks
Content Blocks, specific to the GPCH installation of Planet4.
Install
Install dependencies:
npm install --save-dev
composer install --ignore-platform-reqs
Coding Standards
Any new code added is required to implement Wordpress coding standards
Javascript: Use JSHint
Set JSHint to use .jshintrc provided in this repository.
Example for PHPStorm:
Settings - Languages & Frameworks - Javascript - Code Quality Tools - JSHint
☑ Enable
☑ Use config files
Location: ☑ Default
Build
Make sure your files are formatted correctly:
npm run format
Make sure your files pass ESLint with the provided config:
npm run lint:js
Build files for production:
npm run build
Build styles:
sass assets/css/source/style.scss assets/css/style.css --style=compressed
Autoloader
To generate autoload files, run
composer dump-autoload
Translations
1. Generate .pot files: Use wp-cli or PoEdit. PoEdit is the preferred option as it reads strings from all files including Twig templates.
2. Create the .po and .mo files for each language using Poedit
3. Transform the po files into additional JSON for use with Javascript.
See the guide in dev docs
Example:
wp i18n m