PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.0.2
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.0.2
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 3.10.4 All 148 releases
← All changes | classes/Visualizer/Module/Frontend.php +6 -17 3.0.73.0.2 View file →
@@ -53,9 +53,8 @@
53 53 public function __construct( Visualizer_Plugin $plugin ) {
54 54 parent::__construct( $plugin );
55 55
56 56 $this->_addAction( 'wp_enqueue_scripts', 'enqueueScripts' );
57 - $this->_addFilter( 'visualizer_get_language', 'getLanguage' );
58 57 $this->_addShortcode( 'visualizer', 'renderChart' );
59 58
60 59 // add do_shortocde hook for widget_text filter
61 60 if ( ! has_filter( 'widget_text', 'do_shortcode' ) ) {
@@ -70,16 +69,8 @@
70 69 add_action( 'rest_api_init', array( $this, 'endpoint_register' ) );
71 70 }
72 71
73 72 /**
74 - * Returns the language/locale.
75 - */
76 - function getLanguage( $dummy, $only_language ) {
77 - return $this->get_language();
78 - }
79 -
80 -
81 - /**
82 73 * Registers the endpoints
83 74 */
84 75 function endpoint_register() {
85 76 register_rest_route(
@@ -158,8 +149,9 @@
158 149 wp_register_script( 'visualizer-google-jsapi-new', '//www.gstatic.com/charts/loader.js', array(), null, true );
159 150 wp_register_script( 'visualizer-google-jsapi-old', '//www.google.com/jsapi', array( 'visualizer-google-jsapi-new' ), null, true );
160 151 wp_register_script( 'visualizer-render', VISUALIZER_ABSURL . 'js/render.js', array( 'visualizer-google-jsapi-old', 'jquery' ), Visualizer_Plugin::VERSION, true );
161 152 wp_register_script( 'visualizer-clipboardjs', VISUALIZER_ABSURL . 'js/lib/clipboardjs/clipboard.min.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
153 + wp_enqueue_script( 'visualizer-clipboardjs' );
162 154 wp_register_style( 'visualizer-front', VISUALIZER_ABSURL . 'css/front.css', array(), Visualizer_Plugin::VERSION );
163 155 do_action( 'visualizer_pro_frontend_load_resources' );
164 156 }
165 157
@@ -176,16 +168,15 @@
176 168 * @access public
177 169 * @param array $atts The array of shortcode attributes.
178 170 */
179 171 public function renderChart( $atts ) {
180 - global $wp_version;
181 172 $atts = shortcode_atts(
182 173 array(
183 174 'id' => false, // chart id
184 - 'class' => false, // chart class
185 - 'series' => false, // series filter hook
186 - 'data' => false, // data filter hook
187 - 'settings' => false, // data filter hook
175 + 'class' => false, // chart class
176 + 'series' => false, // series filter hook
177 + 'data' => false, // data filter hook
178 + 'settings' => false, // data filter hook
188 179 ), $atts
189 180 );
190 181
191 182 // if empty id or chart does not exists, then return empty string
@@ -246,11 +237,10 @@
246 237 wp_enqueue_script( 'visualizer-render' );
247 238 wp_localize_script(
248 239 'visualizer-render', 'visualizer', array(
249 240 'charts' => $this->_charts,
250 - 'language' => $this->get_language(),
251 241 'map_api_key' => get_option( 'visualizer-map-api-key' ),
252 - 'rest_url' => version_compare( $wp_version, '4.7.0', '>=' ) ? rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ) : '',
242 + 'rest_url' => rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ),
253 243 'i10n' => array(
254 244 'copied' => __( 'Copied!', 'visualizer' ),
255 245 ),
256 246 )
@@ -275,9 +265,8 @@
275 265
276 266 if ( 'copy' === $key ) {
277 267 $copy = $this->_getDataAs( $atts['id'], 'csv' );
278 268 $actions_div .= ' data-clipboard-text="' . esc_attr( $copy['csv'] ) . '"';
279 - wp_enqueue_script( 'visualizer-clipboardjs' );
280 269 }
281 270
282 271 $actions_div .= apply_filters( 'visualizer_action_attributes', '', $key, $atts['id'] );
283 272 $actions_div .= '>' . $label . '</a> &nbsp;';