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
@@ -352,6 +352,42 @@ The `php/` directory holds the PHP template files for the WordPress theme. Other
352
352
-`partials` - Twig templates for components or pieces of the page to be reused should go here.
353
353
-`shortcodes` - Twig templates for shortcodes should go here.
354
354
355
+
## Plugins
356
+
357
+
### Installing Plugins
358
+
359
+
Install plugins via `composer` by running `npm run php:run composer require wpackagist-plugin/<plugin-name>:<version-number-or-range>`. For example:
360
+
361
+
```sh
362
+
# install a specific version/range for advanced-custom-fields
363
+
npm run php:run composer require wpackagist-plugin/advanced-custom-fields:^6.1
364
+
365
+
# or just install the latest version, letting composer resolve the range
366
+
npm run php:run composer require wpackagist-plugin/advanced-custom-fields
367
+
```
368
+
369
+
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.
370
+
371
+
### Updating Plugins
372
+
373
+
You can run `composer require` as above to update existing plugins, or you can do the following.
374
+
375
+
1. Update the version number in the "require" list in `composer.json`.
376
+
1. Run `npm run php:run composer update` to update `composer.lock`.
377
+
378
+
Again, you'll need to rebuild and restart your container to see the changes reflected in WordPress.
379
+
380
+
### Recommended Plugins
381
+
382
+
This is a non-comprehensive list of plugins that we have found useful on other projects.
383
+
384
+
-[Metabox][metabox]
385
+
-[Advanced Custom Fields][advanced-custom-fields]
386
+
-[Yoast SEO][yoast-seo]
387
+
-[Google Site Kit][google-site-kit]
388
+
-[Contact Form 7][contact-form-7]
389
+
-[Rollbar][rollbar]
390
+
355
391
## Generators
356
392
357
393
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.
@@ -489,45 +525,9 @@ The following file will be created based on your input:
Install plugins via `composer` by running `npm run php:run composer require wpackagist-plugin/<plugin-name>:<version-number-or-range>`. For example:
497
-
498
-
```sh
499
-
# install a specific version/range for advanced-custom-fields
500
-
npm run php:run composer require wpackagist-plugin/advanced-custom-fields:^6.1
501
-
502
-
# or just install the latest version, letting composer resolve the range
503
-
npm run php:run composer require wpackagist-plugin/advanced-custom-fields
504
-
```
505
-
506
-
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.
507
-
508
-
### Updating Plugins
509
-
510
-
You can run `composer require` as above to update existing plugins, or you can do the following.
511
-
512
-
1. Update the version number in the "require" list in `composer.json`.
513
-
1. Run `npm run php:run composer update` to update `composer.lock`.
514
-
515
-
Again, you'll need to rebuild and restart your container to see the changes reflected in WordPress.
516
-
517
-
### Recommended Plugins
518
-
519
-
This is a non-comprehensive list of plugins that we have found useful on other projects.
520
-
521
-
-[Metabox][metabox]
522
-
-[Advanced Custom Fields][advanced-custom-fields]
523
-
-[Yoast SEO][yoast-seo]
524
-
-[Google Site Kit][google-site-kit]
525
-
-[Contact Form 7][contact-form-7]
526
-
-[Rollbar][rollbar]
527
-
528
-
## Custom Blocks
528
+
## Implementing Custom Blocks
529
529
530
-
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.
530
+
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.
531
531
532
532
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