Registering block templates via plugins in WordPress 6.7 #346
Labels
[Feature] Accommodation
Accommodation post type related issues and PRs
[Feature] Destinations
Destinations post type related issues and PRs
[Feature] Tours
Tours post type related issues and PRs
[Status] Needs Dev
Ready for, and needs developer efforts
[Type] Copy
Issues or PRs that need copy editing assistance
[Type] Task
Issues or PRs that have been broken down into an individual action to take
Milestone
Description
We need to register three custom post types in the Tour Operator plugin: Tours, Accommodation, and Destinations. These post types will manage content related to the tours offered, accommodations available, and destinations covered within the plugin.
Requirements
register_block_template()
function, ensuring compatibility with the block editor.register_block_pattern()
with appropriate categories (e.g., tours, accommodation, destinations).Tempalte Registration:
customTemplates
property in thetheme.json
file to register custom templates. Each template should be defined using an array of template objects with the following properties:name
: The name of the template file without the file extension.title
: A human-readable title for the template, which can be translated.postTypes
: An array of post type slugs that the template is usable on (optional, defaults topage
if not specified)./templates
folder. For example, a template registered with the nameexample
should correspond to a file named/templates/example.html
.Templates to Register:
Single Templates:
Archive Templates:
Term Archives
Search Results
References:
customTemplates
property in theme.json. It accepts an array of template objects, each defining an individual template.customTemplates
array supports these properties:name
: The name of your template file without the file extension.title
: A human-readable title for your template, which may be translated.postTypes
: An array of post type slugs that the template is usable on. This is an optional setting and defaults to thepage
post type./templates
folder. Therefore, if you register a template with the name of example, you must also have an/templates/example.html
file in your theme.The text was updated successfully, but these errors were encountered: