Hello @philipp_halla,
Thanks for writing in!
The most common use of has_shortcode should always be this:
function custom_shortcode_scripts() {
global $post;
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'custom-shortcode') ) {
wp_enqueue_script( 'custom-script');
}
}
add_action( 'wp_enqueue_scripts', 'custom_shortcode_scripts');
This should work when adding any shortcode inside a raw content element or with a classic text element. Just do not place your shortcode inside the v2 text element because it’s content will be inserted in a post meta and not in the post content. I would recommend that you output the whole $post->post_content like print_r($post->post_content) to check whether your shortcode is present or not.
If you would be kind enough, please also provide your codes in your next reply so that we can check it.
Regards.