Filter
rpress_pie_graph_output
On this page
Filters the HTML and script output of a pie graph.
Runs when RPRESS_Pie_Graph builds its markup, after the chart script and containers are rendered into a buffer. The output is only built when the graph has data. The result is later passed through wp_kses by display(), which allows only script and div tags with limited attributes.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$output | string | The rendered script and container markup. |
$graph_id | string | The unique ID generated for this graph. |
$data | array | The label => value data being plotted. |
$options | array | The pie graph options after defaults are applied. |
Return value#
string. The markup to print.
Example#
function my_pie_graph_output( $output, $graph_id, $data, $options ) {
return $output . '<div id="my-pie-note-' . esc_attr( $graph_id ) . '" class="my-pie-note"></div>';
}
add_filter( 'rpress_pie_graph_output', 'my_pie_graph_output', 10, 4 );
Source#
Applied in:
includes/admin/reporting/class-rpress-pie-graph.php(line 158), inRPRESS_Pie_Graph::build_graph()
See also#
Was this page helpful?
