PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.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/AMP.php +24 -1 3.2.13.3.0 View file →
@@ -63,11 +63,34 @@
63 63 return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
64 64 }
65 65
66 66 /**
67 - * Loads the alterview view of the chart.
67 + * Loads the alternate view of the chart.
68 68 */
69 69 public function get_chart( $chart, $data, $series, $settings ) {
70 + // let's check if there is a view parameter in the GET request.
71 + $view = isset( $_GET['view'] ) ? $_GET['view'] : null;
72 +
73 + if ( ! empty( $view ) ) {
74 + // attachmend id?
75 + if ( is_numeric( $view ) ) {
76 + $view = wp_get_attachment_url( $view );
77 + }
78 +
79 + $attributes = wp_check_filetype( $view );
80 + if ( $attributes && false !== strpos( $attributes['type'], 'image/' ) ) {
81 + // absolute url or relative?
82 + if ( 0 !== strpos( $view, 'http' ) ) {
83 + $view = site_url( $view );
84 + }
85 + $view = '<img src="' . $view . '">';
86 + }
87 +
88 + if ( ! empty( $view ) ) {
89 + return $view;
90 + }
91 + }
92 +
70 93 $view = apply_filters( 'visualizer_amp_view', null, $chart, $data, $series, $settings );
71 94 if ( ! is_null( $view ) ) {
72 95 return $view;
73 96 }