46 lines
933 B
PHP
46 lines
933 B
PHP
<?php
|
|
/**
|
|
* Admin-only bootstrap: enqueues CSS and JS for the meta box and term forms.
|
|
*
|
|
* @package S1_SEO_Meta
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
class S1_SEO_Meta_Admin {
|
|
|
|
public function __construct() {
|
|
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
|
|
}
|
|
|
|
/**
|
|
* Enqueue admin styles and scripts on relevant screens.
|
|
*
|
|
* @param string $hook_suffix Current admin page hook.
|
|
*/
|
|
public function enqueue_assets( $hook_suffix ) {
|
|
$screens = array( 'post.php', 'post-new.php', 'edit-tags.php', 'term.php' );
|
|
|
|
if ( ! in_array( $hook_suffix, $screens, true ) ) {
|
|
return;
|
|
}
|
|
|
|
wp_enqueue_style(
|
|
's1-seo-meta-admin',
|
|
S1_SEO_META_URL . 'admin/css/s1-seo-meta-admin.css',
|
|
array(),
|
|
S1_SEO_META_VERSION
|
|
);
|
|
|
|
wp_enqueue_script(
|
|
's1-seo-meta-admin',
|
|
S1_SEO_META_URL . 'admin/js/s1-seo-meta-admin.js',
|
|
array( 'jquery' ),
|
|
S1_SEO_META_VERSION,
|
|
true
|
|
);
|
|
}
|
|
}
|