PluginProbe
Audio Player Block – Play Audio Beautifully on Any Page / trunk
Audio Player Block – Play Audio Beautifully on Any Page vtrunk
1.6.2 1.6.1 1.6.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 37 releases
audio-player-block / includes / Enqueue.php

Enqueue.php in Audio Player Block – Play Audio Beautifully on Any Page trunk, at includes/Enqueue.php

27 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BPMP;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class Enqueue {
10 function __construct() {
11 add_action('admin_enqueue_scripts', [$this, 'bpmp_admin_enqueue_script']);
12 }
13
14 function bpmp_admin_enqueue_script($screen){
15 global $typenow;
16
17 if ('audio_player_block' === $typenow) {
18 wp_enqueue_script( 'audio-player-block-admin-post', BPMP_DIR_URL . 'build/admin-post.js', [], BPMP_VERSION, true );
19 wp_enqueue_style( 'audio-player-block-admin-post', BPMP_DIR_URL . 'build/admin-post.css', [], BPMP_VERSION );
20
21 if ($screen === "audio_player_block_page_bpmp_demo_page") {
22 wp_enqueue_script( 'audio-player-block-admin-dashboard', BPMP_DIR_URL . 'build/admin-dashboard.js', [ 'react', 'react-dom', 'react-jsx-runtime', 'wp-util' ], BPMP_VERSION, true );
23 wp_enqueue_style( 'audio-player-block-admin-dashboard', BPMP_DIR_URL . 'build/admin-dashboard.css', [], BPMP_VERSION );
24 }
25 }
26 }
27 }