greenpeace / planet4-plugin-blocks
This repository contains the WordPress plugin that provides the blocks to be used with Shortcake UI plugin.
Installs: 33 205
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 22
Forks: 3
Type:wordpress-plugin
Requires (Dev)
- dev-develop
- v1.62
- v1.61
- v1.60
- v1.59
- v1.58
- v1.57
- v1.56
- v1.55
- v1.54
- v1.53.2
- v1.53.1
- v1.53
- v1.52
- v1.51
- v1.50
- v1.49
- v1.48
- v1.47
- v1.46
- v1.45
- v1.44
- v1.43
- v1.42
- v1.41
- v1.40
- v1.39.1
- v1.39
- v1.38
- v1.37
- v1.36
- v1.35
- v1.34.1
- v1.34
- v1.33
- v1.32.1
- v1.32
- v1.31
- v1.30
- v1.29
- v1.28
- v1.27
- v1.26
- v1.25
- v1.24.1
- v1.24
- v1.23
- v1.22.1
- v1.22
- v1.21.0
- v1.20.2
- v1.20.0
- v1.19.0
- v1.18.1
- v1.18
- v1.17
- 1.16
- 1.15
- 1.14
- 1.13
- 1.12
- 1.11
- 1.10.1
- 1.10
- 1.9
- 1.8
- 1.7
- 1.6
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1.1
- 1.1
- v0.101
- v0.41
- 0.1.45
- 0.1.44
- 0.1.43
- 0.1.42.1
- 0.1.42
- 0.1.41
- 0.1.40
- 0.1.39
- 0.1.38
- 0.1.37
- 0.1.36
- 0.1.35
- 0.1.34
- 0.1.33
- 0.1.32
- 0.1.31
- 0.1.30
- 0.1.29
- 0.1.28
- 0.1.27
- 0.1.26
- 0.1.24
- 0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- 0.1.19
- 0.1.18
- 0.1.16
- 0.1.15
- 0.1.14
- 0.1.13
- 0.1.12
- 0.1.11
- 0.1.10
- 0.1.9
- 0.1.8
- 0.1.6
- 0.1.3
- 0.1.0
- dev-master
- dev-languages
- dev-planet-3919
- dev-PLANET-3840
- dev-covers-gutenberg-acf-experiment
- dev-planet-3483-carousel-header-fix
- dev-bug/planet-2402
- dev-feature/test-performance
This package is auto-updated.
Last update: 2022-07-20 12:42:44 UTC
README
Contents
Introduction
This WordPress plugin provides the necessary blocks to be used with Shortcake UI plugin.
Overide default twig templates of blocks
You can overide the default block twig templates by including in your child theme a file with the same name in the subdirectory
/templates/plugins/planet4-plugin-blocks/includes/
How to develop a new block you ask?
-
Create a new controller class that extends Controller inside directory classes/controller/blocks. The class name should follow naming convention, for example Blockname_Controller and its file name should be class-blockname-controller.php.
-
Implement its parent's class two abstract methods. In method prepare_fields() you need to define the blocks fields and in method prepare_data() you need to prepare the data which will be used for rendering.
-
Create the template file that will be used to render your block inside directory includes/blocks. If the name of the file is blockname.twig then you need to set the BLOCK_NAME constant as 'blockname' It also works with html templates. Just add 'php' as the 3rd argument of the block() method.
-
Add your new class name to the array that the Loader function takes as an argument in the plugin's main file.
-
Finally, before committing do composer update --no-dev and composer dump-autoload --optimize in order to add your new class to composer's autoload.
Task automation
We use gulp as automation tools for local development.
Available tasks
gulp lint_css
'checks for css/sass lint errors'gulp lint_js
'checks for js lint errors'gulp sass
'concatanates/compiles sass files into a minified single stylesheet'gulp sass_admin
'concatanates/compiles admin sass files into a minified single stylesheet'gulp uglify
'concatanates/mangles js files into a minified single js file'gulp uglify_admin
'concatanates/mangles admin js files into a minified single js file'gulp watch
'watches for changes in js or sccs and runs the minification tasks'gulp git_hooks
'copies repo's git hooks to local git repo'
Composer
We use composer as dependency manager for the this plugin. To install dependencies run
$ composer install
Code standards
We follow the WordPress Coding Standards
We use a custom php codesniffer ruleset which adds some rules over WordPress-Core, WordPress-Docs and WordPress-Extra rulesets.
WordPress Coding Standards Rulesets
WordPress Coding Standards Wiki
To run the php codesniffer
$ vendor/bin/phpcs
or
$ composer sniffs
To run the php code beautifier and fixer
$ vendor/bin/phpcbf
or
$ composer fixes
Contribute
Please read the Contribution Guidelines for Planet4.