Skip to content
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [v3.10.1] - 2026-11-24

- Fix: keep the block editor's default styles for classic themes with editor styles (WP 7.0)

## [v3.10.0] - 2026-11-12

- Feat: declare REST API route args, so params are documented and validated by WordPress (malformed values now return a 400)
Expand Down
2 changes: 1 addition & 1 deletion openpub-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Yard | OpenPub Base
* Plugin URI: https://www.openwebconcept.nl/
* Description: Acts as foundation for other OpenPub related content plugins. This plugin implements actions to allow for other plugins to add and/or change Custom Posttypes, Metaboxes, Taxonomies, en Posts 2 posts relations.
* Version: 3.10.0
* Version: 3.10.1
* Author: Yard | Digital Agency
* Author URI: https://www.yard.nl/
* License: GPL-3.0
Expand Down
26 changes: 26 additions & 0 deletions src/Base/Admin/AdminServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ public function register(): void
$this->plugin->loader->addFilter('post_type_link', $this, 'filterPostLink', 10, 4);
$this->plugin->loader->addFilter('preview_post_link', $this, 'filterPreviewLink', 10, 2);
$this->plugin->loader->addAction('rest_prepare_openpub-item', $this, 'filterPreviewInNewTabLink', 10, 2);
$this->plugin->loader->addFilter('block_editor_settings_all', $this, 'filterEditorStyles', 20);
}

/**
* Keep the block editor's default styles for classic themes with editor styles (WP 7.0).
*/
public function filterEditorStyles(array $settings): array
{
// Block themes manage their own editor styles.
if (function_exists('wp_theme_has_theme_json') && wp_theme_has_theme_json()) {
return $settings;
}

if (empty($settings['styles']) || ! is_array($settings['styles'])) {
return $settings;
}

// While any style is typed 'theme' (and "Use theme styles" is on), the editor drops its default and layout styles.
foreach ($settings['styles'] as &$style) {
if ('theme' === ($style['__unstableType'] ?? null)) {
$style['__unstableType'] = 'base-layout';
}
}
unset($style);

return $settings;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Foundation/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Plugin
{
public const NAME = 'openpub-base';
public const VERSION = '3.10.0';
public const VERSION = '3.10.1';

protected string $rootPath;
public Config $config;
Expand Down
Loading