Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/src/ export-ignore -diff
/vendor/ export-ignore -diff
/node_modules export-ignore
/tests export-ignore
Expand All @@ -13,13 +14,17 @@
/.plugin-data export-ignore
/.stylelintrc export-ignore
/.wp-env.json export-ignore
/.wp-env.test.json export-ignore
/CHANGELOG.md export-ignore
/composer.json export-ignore
/composer.lock export-ignore -diff
/eslint.config.cjs export-ignore -diff
/grumphp.yml export-ignore
/LICENSE.md export-ignore
/package.json export-ignore
/package-lock.json export-ignore -diff
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/webpack.config.js export-ignore
/yarn.lock export-ignore
2 changes: 1 addition & 1 deletion .plugin-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "2.0.1",
"version": "2.1.0",
"slug": "blockparty-tabs"
}
2 changes: 1 addition & 1 deletion .wordpress-org/blueprints/blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"pluginData": {
"resource": "git:directory",
"url": "https://github.com/BeAPI/blockparty-tabs",
"ref": "2.0.1",
"ref": "2.1.0",
"refType": "tag"
},
"options": {
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.1.0 - 2026-10-09

- Add WP-CLI command `wp blockparty-tabs migrate-from-tabs-block` to migrate `beapi/tabs*` content to `blockparty/tabs*` (`--dry-run`, `--post-type`, `--posts-per-page`)
- Add `MIGRATION.md` for upgrading from `beapi/tabs-block`
- Add PHPUnit coverage for the tabs block migrator

## 2.0.1 - 2026-09-29

- Fix full-width (`alignfull`) tabs so panel padding is reset correctly
Expand Down
86 changes: 86 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Migrating from `beapi/tabs-block` to `blockparty-tabs`

This document describes how to move from the abandoned [`beapi/tabs-block`](https://github.com/BeAPI/beapi-tabs-block) package to `beapi/blockparty-tabs`.

## Package swap

```bash
composer remove beapi/tabs-block
composer require beapi/blockparty-tabs
```

Activate `blockparty-tabs` and deactivate `beapi-tabs-block` (or `tabs-block`).

## Block model changes

| Old | New |
|---|---|
| `beapi/tabs` | `blockparty/tabs` |
| `beapi/tabs-nav` | `blockparty/tabs-nav` |
| `beapi/tabs-nav-item` | `blockparty/tabs-nav-item` |
| `beapi/tabs-panels` | `blockparty/tabs-panels` |
| `beapi/tabs-panel-item` | `blockparty/tabs-panel-item` |
| Parent `title` (saved as `aria-label` on the root) | `ariaLabel` on `blockparty/tabs-nav` |
| CSS `.wp-block-beapi-tabs` | CSS `.wp-block-blockparty-tabs` |

Nested structure (nav + panels, paired nav/panel items) is preserved. Icons inside tab labels keep working when `blockparty-icons` or `beapi/icon-block` is active (`blockparty_tabs_allowed_icon_blocks` filter).

## Content migration (WP-CLI)

WP-CLI only loads **active** plugins. If you see `'blockparty-tabs' is not a registered wp command`, activate the plugin first:

```bash
wp plugin activate blockparty-tabs
```

After activating `blockparty-tabs` and updating theme allowlists:

```bash
# Preview (current site)
wp blockparty-tabs migrate-from-tabs-block --dry-run

# Apply on the current site
wp blockparty-tabs migrate-from-tabs-block

# Limit post types
wp blockparty-tabs migrate-from-tabs-block --post-type=post,page
```

The command always targets **one site only**. On multisite, repeat it yourself with `--url=` for each site:

```bash
wp blockparty-tabs migrate-from-tabs-block --url=https://example.com/
```

The command:

1. Scans `post_content` for `beapi/tabs*` block comments and legacy class names
2. Parses blocks, converts markup recursively, serializes back
3. Moves the parent `title` attribute to `ariaLabel` on `blockparty/tabs-nav`
4. Aligns saved HTML with blockparty-tabs `save()` output (ARIA roles, `is-active` / `is-hidden` classes)
5. Updates posts with `wp_slash()` on content
6. Logs migrated / skipped counts

### Revisions

Only the scanned post types are migrated (public REST post types + `wp_block` by default). **Revisions are not included** unless you pass them explicitly:

```bash
wp blockparty-tabs migrate-from-tabs-block --post-type=revision
```

### Duplicate Post (Yoast)

If [Yoast Duplicate Post](https://wordpress.org/plugins/duplicate-post/) is active, updating a Rewrite & Republish **copy** via `wp_update_post()` can abort the WP-CLI run.

Preferred workaround: skip that plugin for the migration only:

```bash
wp --skip-plugins=duplicate-post blockparty-tabs migrate-from-tabs-block --url=https://example.com/
```

## Front-end checklist

- Update theme allowlists from `beapi/tabs*` to `blockparty/tabs*`
- Update theme SCSS selectors from `.wp-block-beapi-tabs` to `.wp-block-blockparty-tabs`
- Smoke-test top alignment and sidebar layouts, keyboard navigation, and nested tabs
14 changes: 12 additions & 2 deletions blockparty-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Accessible Tabs block for WordPress gutenberg.
* Requires at least: 6.4
* Requires PHP: 8.1
* Version: 2.0.1
* Version: 2.1.0
* Author: Be API Technical team
* Author URI: https://beapi.fr
* License: GPL-2.0-or-later
Expand All @@ -14,7 +14,13 @@

namespace Blockparty\Tabs;

define( 'BLOCKPARTY_TABS_VERSION', '2.0.1' );
use Blockparty\Tabs\Cli\MigrateFromTabsBlockCommand;

if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
include_once __DIR__ . '/vendor/autoload.php';
}

define( 'BLOCKPARTY_TABS_VERSION', '2.1.0' );
define( 'BLOCKPARTY_TABS_URL', plugin_dir_url( __FILE__ ) );
define( 'BLOCKPARTY_TABS_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLOCKPARTY_TABS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Expand Down Expand Up @@ -174,3 +180,7 @@ function register_react_jsx_runtime( $scripts ): void {
}

add_action( 'wp_default_scripts', __NAMESPACE__ . '\\register_react_jsx_runtime' );

if ( defined( 'WP_CLI' ) && WP_CLI && class_exists( MigrateFromTabsBlockCommand::class ) ) {
\WP_CLI::add_command( 'blockparty-tabs migrate-from-tabs-block', MigrateFromTabsBlockCommand::class );
}
108 changes: 59 additions & 49 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,60 @@
{
"name": "beapi/blockparty-tabs",
"description": "Accessible Tabs block for WordPress gutenberg.",
"type": "wordpress-plugin",
"keywords": ["wordpress", "plugin", "tabs", "gutenberg"],
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "BeAPI",
"email": "technique@beapi.fr"
}
],
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"phpro/grumphp-shim": true
},
"platform": {
"php": "8.1.99"
}
},
"require": {
"php": "^8.1",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"overtrue/phplint": "^9.1",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpro/grumphp-shim": "^1.5",
"phpunit/phpunit": "9.6.37",
"roave/security-advisories": "dev-latest",
"wp-coding-standards/wpcs": "^3.0",
"wp-phpunit/wp-phpunit": "7.1.1",
"yoast/phpunit-polyfills": "4.0.0"
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cb": "./vendor/bin/phpcbf"
},
"scripts-descriptions": {
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset."
}
}
"name": "beapi/blockparty-tabs",
"description": "Accessible Tabs block for WordPress gutenberg.",
"type": "wordpress-plugin",
"keywords": [
"wordpress",
"plugin",
"tabs",
"gutenberg"
],
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "BeAPI",
"email": "technique@beapi.fr"
}
],
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"phpro/grumphp-shim": true
},
"platform": {
"php": "8.1.99"
}
},
"autoload": {
"psr-4": {
"Blockparty\\Tabs\\": "includes/"
}
},
"require": {
"php": "^8.1",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"overtrue/phplint": "^9.1",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpro/grumphp-shim": "^1.5",
"phpunit/phpunit": "9.6.37",
"roave/security-advisories": "dev-latest",
"wp-coding-standards/wpcs": "^3.0",
"wp-phpunit/wp-phpunit": "7.1.1",
"yoast/phpunit-polyfills": "4.0.0"
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cb": "./vendor/bin/phpcbf"
},
"scripts-descriptions": {
"cs": "Run PHP CodeSniffer on codebase using custom ruleset.",
"cb": "Run PHP Code Beautifier and Fixer on codebase using custom ruleset."
}
}
Loading
Loading