PluginProbe
BeyondWords – AI audio for publishers / 7.0.0
BeyondWords – AI audio for publishers v7.0.0
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / editor / classic / class-assets.php

class-assets.php in BeyondWords – AI audio for publishers 7.0.0, at src/editor/classic/class-assets.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * BeyondWords Metabox — asset enqueue.
4 *
5 * @package BeyondWords\Editor\Classic
6 * @since 7.0.0
7 */
8
9 declare( strict_types = 1 );
10
11 namespace BeyondWords\Editor\Classic;
12
13 defined( 'ABSPATH' ) || exit;
14
15 /**
16 * Metabox asset enqueue.
17 *
18 * @since 7.0.0
19 */
20 class Assets {
21
22 /**
23 * Register WordPress hooks.
24 */
25 public static function init(): void {
26 add_action( 'admin_enqueue_scripts', [ self::class, 'admin_enqueue_scripts' ] );
27 }
28
29 /**
30 * Enqueue Metabox CSS on classic-editor post screens for compatible post types.
31 *
32 * No API-valid check needed: class-plugin.php only calls init() with a
33 * valid API connection.
34 *
35 * @param string $hook Current admin page hook.
36 */
37 public static function admin_enqueue_scripts( $hook ): void {
38 if ( 'post.php' !== $hook && 'post-new.php' !== $hook ) {
39 return;
40 }
41
42 if ( ! in_array( get_post_type(), \BeyondWords\Settings\Utils::get_compatible_post_types(), true ) ) {
43 return;
44 }
45
46 wp_enqueue_style(
47 'beyondwords-metabox',
48 BEYONDWORDS__PLUGIN_URI . 'src/editor/classic/classic.css',
49 false,
50 BEYONDWORDS__PLUGIN_VERSION
51 );
52 }
53 }
54