Last active
May 2, 2024 14:28
-
-
Save taricco/00e11c8ee1af82eecd902977dd362ee4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** Load editor notice for Video CPT | |
–––––––––––––––––––––––––––––––––––––––––––––––––– ***/ | |
function wsv_video_cpt_notice_script() { | |
// Ensure we are on the admin screen to prevent errors on the front end | |
if (is_admin()) { | |
// Get the current screen object | |
$screen = get_current_screen(); | |
// Check if the current screen is for the 'video' post type | |
if ($screen->post_type == 'video') { | |
wp_enqueue_script('wsv-video-cpt-notice', get_stylesheet_directory_uri() . '/includes/js/wsv_video_cpt_notice.js'); | |
} | |
} | |
} | |
add_action('enqueue_block_editor_assets', 'wsv_video_cpt_notice_script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment