Skip to content

Commit 35e7067

Browse files
author
Eugene Manuilov
committed
Added ability to filter chart wrapper class.
1 parent d2b69ba commit 35e7067

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

classes/Visualizer/Module/Frontend.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public function renderChart( $atts ) {
101101
}
102102

103103
$id = 'visualizer-' . $atts['id'];
104-
$class = !empty( $atts['class'] ) ? ' class="' . $atts['class'] . '"' : '';
104+
$class = apply_filters( Visualizer_Plugin::FILTER_CHART_WRAPPER_CLASS, $atts['class'], $atts['id'] );
105+
$class = !empty( $class ) ? ' class="' . $class . '"' : '';
105106

106107
$type = get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
107108

classes/Visualizer/Plugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ class Visualizer_Plugin {
5151
const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
5252

5353
// custom filters
54-
const FILTER_GET_CHART_SERIES = 'visualizer-get-chart-series';
55-
const FILTER_GET_CHART_DATA = 'visualizer-get-chart-data';
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';
5657

5758
/**
5859
* Singletone instance of the plugin.

0 commit comments

Comments
 (0)