Skip to content

Commit 12f6458

Browse files
committed
Enqueue options and admin panel assets separately
1 parent 993682f commit 12f6458

File tree

12 files changed

+34
-14
lines changed

12 files changed

+34
-14
lines changed

admin.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/UI/Settings.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static function run(): void
2222

2323
// Load assets
2424
add_action('admin_enqueue_scripts', [self::class, 'enqueue']);
25+
add_action('enqueue_block_editor_assets', [self::class, 'enqueueEditor']);
2526
}
2627

2728
public static function register(): void
@@ -36,11 +37,16 @@ public static function register(): void
3637
public static function enqueue(): void
3738
{
3839
$screen = get_current_screen();
39-
$screens = ['post', 'settings_page_iframely-network', 'settings_page_iframely'];
40+
$screens = ['settings_page_iframely-network', 'settings_page_iframely'];
4041
if (!($screen !== null && in_array($screen->id, $screens))) {
4142
return;
4243
}
43-
wp_enqueue_style('iframely-admin', Plugin::asset('index.css'), [], IFRAMELY_VERSION);
44+
wp_enqueue_style('iframely-admin', Plugin::asset('admin.css'), [], IFRAMELY_VERSION);
45+
}
46+
47+
public static function enqueueEditor(): void
48+
{
49+
wp_enqueue_style('iframely-options', Plugin::asset('index.css'), [], IFRAMELY_VERSION);
4450
}
4551

4652
public static function render(): void

build/admin.asset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php return array('dependencies' => array(), 'version' => 'c51082815623e6e262ce');

build/admin.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/admin.js

Whitespace-only changes.

build/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '30ac48e186677e945e9b');
1+
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'a4ffcff9e90dcd142020');

build/index.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)