Version Description
- Added ability to pass a class for chart wrapper div
- Added proper label for custom post type
Download this release
Release Info
Developer | madpixels |
Plugin | WordPress Charts and Graphs Lite |
Version | 1.4.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.2.1 to 1.4.2.2
- classes/Visualizer/Module/Chart.php +3 -3
- classes/Visualizer/Module/Frontend.php +16 -5
- classes/Visualizer/Module/Setup.php +1 -0
- classes/Visualizer/Plugin.php +4 -3
- index.php +1 -1
- readme.txt +7 -3
classes/Visualizer/Module/Chart.php
CHANGED
@@ -323,7 +323,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
|
|
323 |
),
|
324 |
) );
|
325 |
|
326 |
-
$this->_addAction( 'admin_head', '
|
327 |
|
328 |
wp_iframe( array( $render, 'render') );
|
329 |
}
|
@@ -384,7 +384,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
|
|
384 |
$render->button = esc_attr__( 'Insert Chart', Visualizer_Plugin::NAME );
|
385 |
}
|
386 |
|
387 |
-
$this->_addAction( 'admin_head', '
|
388 |
|
389 |
wp_iframe( array( $render, 'render') );
|
390 |
}
|
@@ -397,7 +397,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
|
|
397 |
*
|
398 |
* @access public
|
399 |
*/
|
400 |
-
public function
|
401 |
echo <<<EOL
|
402 |
<script type="text/javascript">
|
403 |
/* <![CDATA[ */
|
323 |
),
|
324 |
) );
|
325 |
|
326 |
+
$this->_addAction( 'admin_head', 'renderFlattrScript' );
|
327 |
|
328 |
wp_iframe( array( $render, 'render') );
|
329 |
}
|
384 |
$render->button = esc_attr__( 'Insert Chart', Visualizer_Plugin::NAME );
|
385 |
}
|
386 |
|
387 |
+
$this->_addAction( 'admin_head', 'renderFlattrScript' );
|
388 |
|
389 |
wp_iframe( array( $render, 'render') );
|
390 |
}
|
397 |
*
|
398 |
* @access public
|
399 |
*/
|
400 |
+
public function renderFlattrScript() {
|
401 |
echo <<<EOL
|
402 |
<script type="text/javascript">
|
403 |
/* <![CDATA[ */
|
classes/Visualizer/Module/Frontend.php
CHANGED
@@ -57,8 +57,15 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
|
|
57 |
$this->_addAction( 'wp_enqueue_scripts', 'enqueueScripts' );
|
58 |
$this->_addShortcode( 'visualizer', 'renderChart' );
|
59 |
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
/**
|
@@ -70,8 +77,8 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
|
|
70 |
* @access public
|
71 |
*/
|
72 |
public function enqueueScripts() {
|
73 |
-
wp_register_script( 'google-jsapi', '//www.google.com/jsapi', array(), null, true );
|
74 |
-
wp_register_script( 'visualizer-render', VISUALIZER_ABSURL . 'js/render.js', array( 'google-jsapi', 'jquery' ), Visualizer_Plugin::VERSION, true );
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -90,6 +97,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
|
|
90 |
public function renderChart( $atts ) {
|
91 |
$atts = shortcode_atts( array(
|
92 |
'id' => false, // chart id
|
|
|
93 |
'series' => false, // series filter hook
|
94 |
'data' => false, // data filter hook
|
95 |
), $atts );
|
@@ -100,6 +108,9 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
|
|
100 |
}
|
101 |
|
102 |
$id = 'visualizer-' . $atts['id'];
|
|
|
|
|
|
|
103 |
$type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
|
104 |
|
105 |
// faetch and update settings
|
@@ -133,7 +144,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
|
|
133 |
wp_localize_script( 'visualizer-render', 'visualizer', array( 'charts' => $this->_charts ) );
|
134 |
|
135 |
// return placeholder div
|
136 |
-
return '<div id="' . $id . '"></div>';
|
137 |
}
|
138 |
|
139 |
}
|
57 |
$this->_addAction( 'wp_enqueue_scripts', 'enqueueScripts' );
|
58 |
$this->_addShortcode( 'visualizer', 'renderChart' );
|
59 |
|
60 |
+
// add do_shortocde hook for widget_text filter
|
61 |
+
if ( !has_filter( 'widget_text', 'do_shortcode' ) ) {
|
62 |
+
add_filter( 'widget_text', 'do_shortcode' );
|
63 |
+
}
|
64 |
+
|
65 |
+
// add do_shortcode hook for term_description filter
|
66 |
+
if ( !has_filter( 'term_description', 'do_shortcode' ) ) {
|
67 |
+
add_filter( 'term_description', 'do_shortcode' );
|
68 |
+
}
|
69 |
}
|
70 |
|
71 |
/**
|
77 |
* @access public
|
78 |
*/
|
79 |
public function enqueueScripts() {
|
80 |
+
wp_register_script( 'visualizer-google-jsapi', '//www.google.com/jsapi', array(), null, true );
|
81 |
+
wp_register_script( 'visualizer-render', VISUALIZER_ABSURL . 'js/render.js', array( 'visualizer-google-jsapi', 'jquery' ), Visualizer_Plugin::VERSION, true );
|
82 |
}
|
83 |
|
84 |
/**
|
97 |
public function renderChart( $atts ) {
|
98 |
$atts = shortcode_atts( array(
|
99 |
'id' => false, // chart id
|
100 |
+
'class' => false, // chart class
|
101 |
'series' => false, // series filter hook
|
102 |
'data' => false, // data filter hook
|
103 |
), $atts );
|
108 |
}
|
109 |
|
110 |
$id = 'visualizer-' . $atts['id'];
|
111 |
+
$class = apply_filters( Visualizer_Plugin::FILTER_CHART_WRAPPER_CLASS, $atts['class'], $atts['id'] );
|
112 |
+
$class = !empty( $class ) ? ' class="' . $class . '"' : '';
|
113 |
+
|
114 |
$type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
|
115 |
|
116 |
// faetch and update settings
|
144 |
wp_localize_script( 'visualizer-render', 'visualizer', array( 'charts' => $this->_charts ) );
|
145 |
|
146 |
// return placeholder div
|
147 |
+
return '<div id="' . $id . '"' . $class . '></div>';
|
148 |
}
|
149 |
|
150 |
}
|
classes/Visualizer/Module/Setup.php
CHANGED
@@ -57,6 +57,7 @@ class Visualizer_Module_Setup extends Visualizer_Module {
|
|
57 |
*/
|
58 |
public function setupCustomPostTypes() {
|
59 |
register_post_type( Visualizer_Plugin::CPT_VISUALIZER, array(
|
|
|
60 |
'public' => false,
|
61 |
) );
|
62 |
}
|
57 |
*/
|
58 |
public function setupCustomPostTypes() {
|
59 |
register_post_type( Visualizer_Plugin::CPT_VISUALIZER, array(
|
60 |
+
'label' => 'Visualizer Chart',
|
61 |
'public' => false,
|
62 |
) );
|
63 |
}
|
classes/Visualizer/Plugin.php
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
class Visualizer_Plugin {
|
31 |
|
32 |
const NAME = 'visualizer';
|
33 |
-
const VERSION = '1.4.2.
|
34 |
|
35 |
// custom post types
|
36 |
const CPT_VISUALIZER = 'visualizer';
|
@@ -51,8 +51,9 @@ class Visualizer_Plugin {
|
|
51 |
const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
|
52 |
|
53 |
// custom filters
|
54 |
-
const
|
55 |
-
const
|
|
|
56 |
|
57 |
/**
|
58 |
* Singletone instance of the plugin.
|
30 |
class Visualizer_Plugin {
|
31 |
|
32 |
const NAME = 'visualizer';
|
33 |
+
const VERSION = '1.4.2.2';
|
34 |
|
35 |
// custom post types
|
36 |
const CPT_VISUALIZER = 'visualizer';
|
51 |
const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
|
52 |
|
53 |
// custom filters
|
54 |
+
const FILTER_CHART_WRAPPER_CLASS = 'visualizer-chart-wrapper-class';
|
55 |
+
const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
|
56 |
+
const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
|
57 |
|
58 |
/**
|
59 |
* Singletone instance of the plugin.
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WordPress Visualizer
|
4 |
Plugin URI: https://github.com/madpixelslabs/visualizer
|
5 |
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
|
6 |
-
Version: 1.4.2.
|
7 |
Author: Madpixels
|
8 |
Author URI: http://madpixels.net
|
9 |
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
|
3 |
Plugin Name: WordPress Visualizer
|
4 |
Plugin URI: https://github.com/madpixelslabs/visualizer
|
5 |
Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
|
6 |
+
Version: 1.4.2.2
|
7 |
Author: Madpixels
|
8 |
Author URI: http://madpixels.net
|
9 |
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: madpixels, straightforward
|
|
3 |
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
|
4 |
Tags: chart, charts, charting, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, canvas, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.4.2.
|
8 |
License: GPL v2.0 or later
|
9 |
License URI: http://www.opensource.org/licenses/gpl-license.php
|
10 |
|
@@ -58,6 +58,10 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
61 |
= 1.4.2.1 =
|
62 |
* Fixed issue with download_url function which not exists at front end
|
63 |
* Added functionality which prevents direct access to the plugin folder
|
@@ -130,4 +134,4 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
|
|
130 |
* The bug with CSV file uploading was fixed.
|
131 |
|
132 |
= 1.0.0 =
|
133 |
-
* The first version of the plugin was implemented.
|
3 |
Donate link: http://flattr.com/thing/2574985/WordPress-Visualizer
|
4 |
Tags: chart, charts, charting, graph, graphs, graphing, visualisation, visualise data, visualization, visualize data, HTML5, canvas, pie chart, line chart, bar chart, column chart, gauge chart, area chart, scatter chart, candlestick chart, geo chart, google visualization api
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.4.2.2
|
8 |
License: GPL v2.0 or later
|
9 |
License URI: http://www.opensource.org/licenses/gpl-license.php
|
10 |
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 1.4.2.2 =
|
62 |
+
* Added ability to pass a class for chart wrapper div
|
63 |
+
* Added proper label for custom post type
|
64 |
+
|
65 |
= 1.4.2.1 =
|
66 |
* Fixed issue with download_url function which not exists at front end
|
67 |
* Added functionality which prevents direct access to the plugin folder
|
134 |
* The bug with CSV file uploading was fixed.
|
135 |
|
136 |
= 1.0.0 =
|
137 |
+
* The first version of the plugin was implemented.
|