| @@ -460,10 +460,10 @@ | ||
| 460 | 460 | $success = $chart && $chart->post_type === Visualizer_Plugin::CPT_VISUALIZER; |
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | if ( $success ) { |
| 464 | - if ( Visualizer_Module::is_pro() && function_exists( 'icl_get_languages' ) ) { | |
| 465 | - global $sitepress; | |
| 464 | + global $sitepress; | |
| 465 | + if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) { | |
| 466 | 466 | $trid = $sitepress->get_element_trid( $chart_id, 'post_' . Visualizer_Plugin::CPT_VISUALIZER ); |
| 467 | 467 | $translations = $sitepress->get_element_translations( $trid ); |
| 468 | 468 | if ( ! empty( $translations ) ) { |
| 469 | 469 | foreach ( $translations as $translated_post ) { |