2
0
Fork 0
mirror of https://github.com/elementor/hello-theme.git synced 2026-03-05 14:52:51 +08:00
hello-theme/modules/admin-home/components/scripts-controller.php

31 lines
556 B
PHP

<?php
namespace HelloTheme\Modules\AdminHome\Components;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
use HelloTheme\Includes\Script;
class Scripts_Controller {
public function __construct() {
add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
}
public function admin_enqueue_scripts() {
$screen = get_current_screen();
if ( 'toplevel_page_' . EHP_THEME_SLUG !== $screen->id ) {
return;
}
$script = new Script(
'hello-home-app',
[ 'wp-util' ]
);
$script->enqueue();
}
}