| @@ -304,9 +304,10 @@ | ||
| 304 | 304 | ), |
| 305 | 305 | $atts |
| 306 | 306 | ); |
| 307 | 307 | |
| 308 | - if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { | |
| 308 | + global $sitepress; | |
| 309 | + if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { | |
| 309 | 310 | global $sitepress; |
| 310 | 311 | $locale = icl_get_current_language(); |
| 311 | 312 | $locale = strtolower( str_replace( '_', '-', $locale ) ); |
| 312 | 313 | $trid = $sitepress->get_element_trid( $atts['id'], 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); |