Skip to content

Commit b33048c

Browse files
committed
docs: document the meta box generator
1 parent e297181 commit b33048c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Out of the box, this template provides a minimal WordPress theme with basic supp
1515
- Shortcodes
1616
- Custom taxonomies
1717
- Reusable patterns
18+
- Meta boxes
1819
- Sample custom blocks which you can reference to create your own custom blocks
1920
- Code style rules that are enforced by language-specific linters
2021
- GitHub Action workflows for code quality, release management, and deployment processes
@@ -453,6 +454,20 @@ The following files will be created based on your input:
453454

454455
See [custom block structure](#custom-block-structure) for more info on what these files are for.
455456

457+
### Meta Box
458+
459+
The generator for meta boxes will prompt you for a meta box name, a label for an input, which post type(s) the meta box should be enabled for, and where the box should be positioned based on context and priority. The generator only adds a single text input field for demonstration purposes. Different input types and advanced use cases will require developers to implement them. It may be better to use a plugin like [Advanced Custom Fields][advanced-custom-fields] for some situations, especially when a WordPress admin should be able to manage the fields without devloper help.
460+
461+
```sh
462+
npm run generate:meta-box
463+
```
464+
465+
The following file will be created based on your input:
466+
467+
- `src/php/inc/meta-boxes/class-<meta-box-name>.php`
468+
469+
[Meta Box documentation](https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/)
470+
456471
## Plugins
457472

458473
### Installing Plugins

0 commit comments

Comments
 (0)