Skip to content

Commit 8683949

Browse files
authored
Merge pull request #916 from Codeinwp/prf/final-fixes
fix: warning thrown in editor because of how the video player icons were added
2 parents 883916d + 3175e5b commit 8683949

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

inc/video_player.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function __construct() {
6565
}
6666

6767
add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_admin_video_player_assets' ] );
68+
add_action( 'admin_head', [ $this, 'add_editor_player_icons' ] );
6869
add_action( 'wp_enqueue_scripts', [ $this, 'maybe_enqueue_video_player_script' ] );
6970
add_action( 'init', [ $this, 'register_video_player_block' ] );
7071
}
@@ -95,6 +96,18 @@ public function enqueue_admin_video_player_assets() {
9596
wp_enqueue_script( $handle );
9697

9798
wp_enqueue_style( $handle, OPTML_URL . 'assets/build/video-player/frontend/style-frontend.css', [], $asset_file['version'] );
99+
}
100+
101+
/**
102+
* Add the video player icons to the editor.
103+
*
104+
* @since 4.0.0
105+
*/
106+
public function add_editor_player_icons() {
107+
$screen = get_current_screen();
108+
if ( ! $screen || ! $screen->is_block_editor() ) {
109+
return;
110+
}
98111

99112
$this->render_player_icons();
100113
}

0 commit comments

Comments
 (0)