From 0f1a6c8184ce1308cd3a80a21e022a597916425d Mon Sep 17 00:00:00 2001 From: contactashish13 Date: Mon, 16 Jan 2017 21:28:46 +0530 Subject: [PATCH] Reuse Shortcode on same page #124 --- classes/Visualizer/Module/Frontend.php | 4 +++- languages/visualizer.pot | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/classes/Visualizer/Module/Frontend.php b/classes/Visualizer/Module/Frontend.php index 071096d6..02aa62ab 100644 --- a/classes/Visualizer/Module/Frontend.php +++ b/classes/Visualizer/Module/Frontend.php @@ -111,7 +111,7 @@ public function renderChart( $atts ) { $id = 'visualizer-' . $atts['id']; $defaultClass = 'visualizer-front'; $class = apply_filters( Visualizer_Plugin::FILTER_CHART_WRAPPER_CLASS, $atts['class'], $atts['id'] ); - $class = $defaultClass . ' ' . $class; + $class = $defaultClass . ' ' . $class . ' ' . 'visualizer-front-' . $atts['id']; $class = ! empty( $class ) ? ' class="' . trim( $class ) . '"' : ''; $type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true ); @@ -139,6 +139,8 @@ public function renderChart( $atts ) { $data = apply_filters( $atts['data'], $data, $chart->ID, $type ); } + $id = $id . '-' . rand(); + // add chart to the array $this->_charts[ $id ] = array( 'type' => $type, diff --git a/languages/visualizer.pot b/languages/visualizer.pot index 2a703252..2b69b4d4 100644 --- a/languages/visualizer.pot +++ b/languages/visualizer.pot @@ -1,14 +1,14 @@ -# Copyright (C) 2016 Themeisle +# Copyright (C) 2017 Themeisle # This file is distributed under the GPL v2.0 or later. msgid "" msgstr "" -"Project-Id-Version: Visualizer: Charts and Graphs Lite 1.7.2\n" +"Project-Id-Version: Visualizer: Charts and Graphs Lite 1.7.5\n" "Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n" -"POT-Creation-Date: 2016-12-09 18:57:52+00:00\n" +"POT-Creation-Date: 2017-01-16 15:53:56+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n" "Last-Translator: Themeisle Translate Team \n" "Language-Team: Themeisle Translate \n" "X-Generator: grunt-wp-i18n 0.5.4\n"