Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ jobs:

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3.0.1
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
if: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && endsWith(github.ref, '.x') }}"
with:
path: "build/docs"
retention-days: 1

deploy:
name: "Deploy"
if: "${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
if: "${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && endsWith(github.ref, '.x') }}"
runs-on: "ubuntu-latest"

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
Expand Down
12 changes: 9 additions & 3 deletions blocks/header/class-header-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ protected function child_blocks(): array {
'logo',
'Logo',
array(),
plugin_dir_path( __FILE__ ) . 'templates/logo.php'
plugin_dir_path( __FILE__ ) . 'templates/logo.php',
array(),
'format-image'
),
new Child_Block(
'general',
'General',
array(),
plugin_dir_path( __FILE__ ) . 'templates/general.php'
plugin_dir_path( __FILE__ ) . 'templates/general.php',
array(),
'admin-generic'
),
new Child_Block(
'menu',
Expand All @@ -85,7 +89,9 @@ protected function child_blocks(): array {
'choices' => $this->get_menu_choices(),
),
),
plugin_dir_path( __FILE__ ) . 'templates/menu.php'
plugin_dir_path( __FILE__ ) . 'templates/menu.php',
array(),
'menu',
),
);
}
Expand Down
12 changes: 12 additions & 0 deletions blocks/search-and-filter/class-search-and-filter-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,36 +208,48 @@ protected function child_blocks(): array {
'Search and Filter Search',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/search.php',
array(),
'search'
),
new Child_Block(
'choice',
'Search and Filter Choice',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/choice.php',
array(),
'yes-alt'
),
new Child_Block(
'range',
'Search and Filter Range',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/range.php',
array(),
'filter'
),
new Child_Block(
'advanced',
'Search and Filter Advanced',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/advanced.php',
array(),
'filter',
),
new Child_Block(
'reusable',
'Search and Filter Reusable',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/reusable.php',
array(),
'filter',
),
new Child_Block(
'control',
'Search and Filter Control',
array(),
plugin_dir_path( __FILE__ ) . 'templates/child-blocks/form/control.php',
array(),
'filter',
),
)
),
Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default defineConfig({
collapsed: false,
items: [
{ text: 'What Is It?', link: '/what-is-it' },
{ text: 'Quick Start', link: '/quick-start' }
{ text: 'Quick Start', link: '/quick-start' },
{ text: 'Upgrading', link: '/upgrading' },
]
},
{
Expand Down
25 changes: 25 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Upgrading
editLink: false
---

# Upgrading
This guide covers breaking changes between versions of the block plugin. If you are upgrading from a version prior to 1.x, you will need to follow the instructions below.

## Upgrading from 0.x to 1.x

### Changes to the block class
As part of the upgrade to 1.x of the block plugin, the base block class now includes the `Trait_Has_Modifier_Classes` trait. This trait is used to add modifier classes to the block.

This change breaks existing blocks due to the requirement of a new `default-wrapper.php` template for blocks. In order to upgrade, you will need to add the following function declaration to any existing block classes created prior to 1.x:

```php
/**
* {@inheritdoc}
*/
protected function use_default_wrapper_template(): bool {
return false;
}
```

This ensures that the block will not use the default wrapper template.