I would like to disable embeds for specific custom user roles. I found this solution to disable embeds from WPPagebuilders:
function my_deregister_scripts(){
wp_dequeue_script( 'wp-embed' );
}
add_action( 'wp_footer', 'my_deregister_scripts' );
How might I add something like, "if user role is X or Y, use this function"?