PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.6.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.6.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Module/Frontend.php +10 -2 3.5.13.6.0 View file →
@@ -271,12 +271,13 @@
271 271 // for lazy load
272 272 // set 'yes' to use the default intersection limit (300px)
273 273 // OR set a number (e.g. 700) to use 700px as the intersection limit
274 274 'lazy' => apply_filters( 'visualizer_lazy_by_default', false, $atts['id'] ),
275 + // Use image chart
276 + 'use_image' => 'no',
275 277 ),
276 278 $atts
277 279 );
278 -
279 280 // if empty id or chart does not exists, then return empty string
280 281 if ( ! $atts['id'] || ! ( $chart = get_post( $atts['id'] ) ) || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) {
281 282 return '';
282 283 }
@@ -339,9 +340,16 @@
339 340 $id = $id . '-' . rand();
340 341
341 342 $amp = Visualizer_Plugin::instance()->getModule( Visualizer_Module_AMP::NAME );
342 343 if ( $amp && $amp->is_amp() ) {
343 - return '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . $amp->get_chart( $chart, $data, $series, $settings ) . '</div>';
344 + return '<div data-amp-auto-lightbox-disable id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . $amp->get_chart( $chart, $data, $series, $settings ) . '</div>';
345 + }
346 +
347 + if ( 'yes' === $atts['use_image'] ) {
348 + $chart_image = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_IMAGE, true );
349 + if ( $chart_image ) {
350 + return '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '>' . wp_get_attachment_image( $chart_image, 'full' ) . '</div>';
351 + }
344 352 }
345 353
346 354 // add chart to the array
347 355 $this->_charts[ $id ] = array(