-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Notes
Rob Knight edited this page May 10, 2022
·
10 revisions
A collection of links, code snippets, and documentation of things we've learned along the way.
- In theme directory, run
npm run build && composer install
- Release
npm run release -- --release-as X.X.X-beta.X
- Updates the CHANGELOG
- Bumps version in NPM package
- TODO: how to bump version in style.css?
- Run
npm run zip
- Added
build
directory to the repo and deploying from Github directly to the CampusPress Bitbucket repo. - We need to add pre-deploy testing and code formatting
- An Introduction to WordPress Block Themes
- How to Use The @wordpress/scripts Build Tool with Custom WordPress Blocks
- Core Blocks Reference
- Install PHP_CodeSniffer
- Install the WordPress Coding Standards in a permanent location in your filesystem. PHPCS will need to reference the location.
- Add the WPCS path from above ⬆️ to PHPCS's
installed_paths
config setting. - Install PHPCS extension for VC Code
- Add settings to VS Code (settings.json):
"phpcs.enable": true,
"phpcs.executablePath": "/path/to/.composer/vendor/bin/phpcs",
"phpcs.standard": "WordPress",
"phpcs.showWarnings": true,
"phpcs.composerJsonPath": "composer.json",
- https://publishing-project.rivendellweb.net/linting-wordpress-php-code/
- https://seravo.com/blog/coding-wordpress-in-style-with-phpcs/
- https://tommcfarlin.com/php-codesniffer/
Official docs for 'patterns,' a way to group blocks into reusable patterns. Patterns are available everywhere you can use blocks.
{
"__file": "wp_block",
"title": "UCSC Global Navigation",
"content": "<!-- wp:navigation {\"textColor\":\"ucsc-primary-blue\",\"showSubmenuIcon\":false,\"layout\":{\"type\":\"flex\",\"justifyContent\":\"left\"},\"style\":{\"typography\":{\"textTransform\":\"capitalize\",\"fontStyle\":\"normal\",\"fontWeight\":\"600\",\"lineHeight\":\"1.2\",\"fontSize\":\"1.125rem\"}}} --> <!-- wp:navigation-link {\"label\":\"MyUCSC\", \"url\":\"https://my.ucsc.edu/\"} /--> <!-- wp:navigation-link {\"label\":\"All the People\", \"url\":\"https://www.ucsc.edu/tools/people.html\"} /--> <!-- wp:navigation-link {\"label\":\"Calendars\", \"url\":\"https://www.ucsc.edu/tools/calendars.html\"} /--> <!-- wp:navigation-link {\"label\":\"Maps\", \"url\":\"https://www.ucsc.edu/visit/maps-directions.html\"} /--> <!-- wp:navigation-link {\"label\":\"A-Z Index\", \"url\":\"https://www.ucsc.edu/tools/azindex.html\"} /--> <!-- /wp:navigation -->"
}