You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -351,6 +351,42 @@ The `php/` directory holds the PHP template files for the WordPress theme. Other
351
351
-`partials` - Twig templates for components or pieces of the page to be reused should go here.
352
352
-`shortcodes` - Twig templates for shortcodes should go here.
353
353
354
+
## Plugins
355
+
356
+
### Installing Plugins
357
+
358
+
Install plugins via `composer` by running `npm run php:run composer require wpackagist-plugin/<plugin-name>:<version-number-or-range>`. For example:
359
+
360
+
```sh
361
+
# install a specific version/range for advanced-custom-fields
362
+
npm run php:run composer require wpackagist-plugin/advanced-custom-fields:^6.1
363
+
364
+
# or just install the latest version, letting composer resolve the range
365
+
npm run php:run composer require wpackagist-plugin/advanced-custom-fields
366
+
```
367
+
368
+
Running this command will update `composer.json` and `composer.lock`, but you will need to rebuild (`docker compose build`) and restart your container (`npm start` or `npm run serve:dev`) to see the new plugin reflected in the WordPress admin.
369
+
370
+
### Updating Plugins
371
+
372
+
You can run `composer require` as above to update existing plugins, or you can do the following.
373
+
374
+
1. Update the version number in the "require" list in `composer.json`.
375
+
1. Run `npm run php:run composer update` to update `composer.lock`.
376
+
377
+
Again, you'll need to rebuild and restart your container to see the changes reflected in WordPress.
378
+
379
+
### Recommended Plugins
380
+
381
+
This is a non-comprehensive list of plugins that we have found useful on other projects.
382
+
383
+
-[Metabox][metabox]
384
+
-[Advanced Custom Fields][advanced-custom-fields]
385
+
-[Yoast SEO][yoast-seo]
386
+
-[Google Site Kit][google-site-kit]
387
+
-[Contact Form 7][contact-form-7]
388
+
-[Rollbar][rollbar]
389
+
354
390
## Generators
355
391
356
392
We have a handful of generators to make it easier to add new custom post types, taxonomies, shortcodes, and page templates. If none of the generators give you what you need, you can try using https://generatewp.com/ to get more relevant code snippets.
@@ -474,45 +510,9 @@ The following files will be created based on your input:
474
510
475
511
See [custom block structure](#custom-block-structure) for more info on what these files are for.
476
512
477
-
## Plugins
478
-
479
-
### Installing Plugins
480
-
481
-
Install plugins via `composer` by running `npm run php:run composer require wpackagist-plugin/<plugin-name>:<version-number-or-range>`. For example:
482
-
483
-
```sh
484
-
# install a specific version/range for advanced-custom-fields
485
-
npm run php:run composer require wpackagist-plugin/advanced-custom-fields:^6.1
486
-
487
-
# or just install the latest version, letting composer resolve the range
488
-
npm run php:run composer require wpackagist-plugin/advanced-custom-fields
489
-
```
490
-
491
-
Running this command will update `composer.json` and `composer.lock`, but you will need to rebuild (`docker compose build`) and restart your container (`npm start` or `npm run serve:dev`) to see the new plugin reflected in the WordPress admin.
492
-
493
-
### Updating Plugins
494
-
495
-
You can run `composer require` as above to update existing plugins, or you can do the following.
496
-
497
-
1. Update the version number in the "require" list in `composer.json`.
498
-
1. Run `npm run php:run composer update` to update `composer.lock`.
499
-
500
-
Again, you'll need to rebuild and restart your container to see the changes reflected in WordPress.
501
-
502
-
### Recommended Plugins
503
-
504
-
This is a non-comprehensive list of plugins that we have found useful on other projects.
505
-
506
-
-[Metabox][metabox]
507
-
-[Advanced Custom Fields][advanced-custom-fields]
508
-
-[Yoast SEO][yoast-seo]
509
-
-[Google Site Kit][google-site-kit]
510
-
-[Contact Form 7][contact-form-7]
511
-
-[Rollbar][rollbar]
512
-
513
-
## Custom Blocks
513
+
## Implementing Custom Blocks
514
514
515
-
We have two [generators](#generators) that can be used in tandem to create the necessary scaffolding for custom blocks. The first is `npm run generate:custom-blocks-plugin`, which should be run first to create the plugin config, readme, directory, and `package.json`/`docker-compose.yml` changes necessary to make the plugin available to WordPress. The second is `npm run generate:custom-block`, which creates the boilerplate files necessary to create a single custom block within the plugin.
515
+
To implement custom blocks, begin by using the two [generators](#generators) in tandem to create the necessary scaffolding for custom blocks. The first is `npm run generate:custom-blocks-plugin`, which should be run first to create the plugin config, readme, directory, and `package.json`/`docker-compose.yml` changes necessary to make the plugin available to WordPress. The second is `npm run generate:custom-block`, which creates the boilerplate files necessary to create a single custom block within the plugin.
516
516
517
517
Note: you will need to restart your development process to pick up the changes after adding a custom blocks plugin and/or a custom block.
0 commit comments