Skip to content

Commit c6cdad7

Browse files
authored
Merge pull request #899 from Codeinwp/bugfix/898
Fix PHP 8.0 or above compatibility issue
2 parents f65fc35 + 9ffaa8a commit c6cdad7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ private function deleteOldCharts() {
490490
*/
491491
public function renderChartPages() {
492492
defined( 'IFRAME_REQUEST' ) || define( 'IFRAME_REQUEST', 1 );
493+
if ( ! defined( 'ET_BUILDER_PRODUCT_VERSION' ) && function_exists( 'et_get_theme_version' ) ) {
494+
define( 'ET_BUILDER_PRODUCT_VERSION', et_get_theme_version() );
495+
}
493496
// Set current screen for the render chart.
494497
set_current_screen( 'visualizer_render_chart' );
495498
// check chart, if chart not exists, will create new one and redirects to the same page with proper chart id
@@ -524,7 +527,11 @@ public function renderChartPages() {
524527
do_action( 'visualizer_pro_new_chart_defaults', $chart_id );
525528
}
526529
wp_redirect( add_query_arg( 'chart', (int) $chart_id ) );
527-
defined( 'WP_TESTS_DOMAIN' ) ? wp_die() : exit();
530+
531+
if ( defined( 'WP_TESTS_DOMAIN' ) ) {
532+
wp_die();
533+
}
534+
exit();
528535
}
529536

530537
$_POST['save_chart_image'] = isset( $_POST['save_chart_image'] ) && 'yes' === $_POST['save_chart_image'] ? true : false;

0 commit comments

Comments
 (0)