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

Widget Visibility: Disable in Block Editor #17413

Merged
merged 2 commits into from
Oct 9, 2020
Merged
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
6 changes: 6 additions & 0 deletions modules/widget-visibility/widget-conditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public static function init() {
}

public static function widget_admin_setup() {
$current_screen = get_current_screen();
// TODO: Replace `$current_screen->is_block_editor()` with `wp_should_load_block_editor_scripts_and_styles()` that is introduced in WP 5.6
jeherve marked this conversation as resolved.
Show resolved Hide resolved
if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
return;
}

wp_enqueue_style( 'widget-conditions', plugins_url( 'widget-conditions/widget-conditions.css', __FILE__ ) );
wp_style_add_data( 'widget-conditions', 'rtl', 'replace' );
wp_enqueue_script(
Expand Down