| 1 |
<?php |
| 2 |
/** Keep third-party admin notices outside Blockenberg page headers. */ |
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
add_action( 'admin_enqueue_scripts', function ( $hook ) { |
| 6 |
if ( ! in_array( $hook, array( 'toplevel_page_blockenberg', 'blockenberg_page_blockenberg-ai', 'blockenberg_page_blockenberg-templates' ), true ) ) { |
| 7 |
return; |
| 8 |
} |
| 9 |
$base = dirname( __DIR__, 2 ); |
| 10 |
$url = plugins_url( '', $base . '/blockenberg.php' ); |
| 11 |
wp_enqueue_style( 'bkbg-admin-notices', $url . '/assets/css/admin-notices.css', array(), filemtime( $base . '/assets/css/admin-notices.css' ) ); |
| 12 |
wp_enqueue_script( 'bkbg-admin-notices', $url . '/assets/js/admin-notices.js', array( 'jquery', 'common' ), filemtime( $base . '/assets/js/admin-notices.js' ), true ); |
| 13 |
wp_localize_script( 'bkbg-admin-notices', 'bkbgAdminNotices', array( 'label' => __( 'Notifications', 'blockenberg' ) ) ); |
| 14 |
} ); |
| 15 |
|