plugin development – check shortcode exist inside elementor
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
8 times
I am trying to check if there is a shortcode contact form 7 inside a page but that is not working as usual as the page is built with elementor
Function has_shortcode
I have tried this solution but It does not work also
if ( defined( 'ELEMENTOR_PRO_VERSION' ) || defined( 'ELEMENTOR_VERSION' ) ) {
$data = get_post_meta( $post->ID, '_elementor_data', true );
if ( !empty( $data ) && has_shortcode( $data, $shortcode ) ) {
return true;
}
}
Thanks in advance
2
default
Leave an answer