function customize_elementor() {
// Remove Elementor Nag Admin Notices
echo ‘<style>.e-notice–cta { display: none !important; }</style>’;
// Remove Elementor AI script from editor
if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
wp_dequeue_script( ‘elementor-ai’ );
wp_dequeue_script( ‘elementor-ai-media-library’ );
}
// Dequeue Elementor AI media library and Gutenberg scripts in admin
wp_dequeue_script( ‘elementor-ai-media-library’ );
wp_dequeue_script( ‘elementor-ai-gutenberg’ );
}
// Hook for removing Elementor nag in admin
add_action( ‘admin_head’, ‘customize_elementor’ );
// Hook for removing Elementor AI scripts from editor
add_action( ‘elementor/editor/after_enqueue_scripts’, ‘customize_elementor’ );
// Hook for dequeuing Elementor AI media library and Gutenberg scripts in admin
add_action(‘admin_enqueue_scripts’, ‘customize_elementor’, 100);
I understand the logic. Sorry for my unfair comment. I’m fixing it. Thanks for the return.