Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pattern editor #134

Closed
wants to merge 1 commit into from
Closed
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
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Added support for WP Block site pattern editor.

### Fixed

- Fatal error when deleting a menu in the backoffice.
Expand Down
8 changes: 6 additions & 2 deletions lib/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public static function is_block_editor( WP_Screen $screen = null ) : bool {
*
* Stop enqueuing scripts if the current screen is for an untranslatable post type.
*
* @since Unreleased Add WP_Block support and fix issue with bad return.
* @since 0.4.0
*
* @return bool
Expand All @@ -229,9 +230,12 @@ private function should_enqueue_scripts() : bool {

if (
! $screen instanceof WP_Screen
|| $screen->base !== 'post'
|| (
$screen->base !== 'post'
&& ! ( LangInterface::is_post_type_translatable( 'wp_block' ) && $screen->base === 'site-editor' )
)
) {
return true;
return false;
}

$post_type = get_post_type();
Expand Down