Skip to content
Docs
Get RestroPress

Action

rpress_before_graph

Updated
On this page

Fires before a graph is output.

Runs at the start of RPRESS_Graph::display(), before the graph script and container are printed. The graph object is passed so a callback can adjust its options or print markup above the chart.

Parameters#

ParameterTypeDescription
$graphRPRESS_GraphThe graph object about to be displayed.

Example#

function my_before_graph( $graph ) {
	echo '<h4>' . esc_html__( 'Last 30 days', 'my-plugin' ) . '</h4>';
}
add_action( 'rpress_before_graph', 'my_before_graph', 10, 1 );

Source#

Fired from:

  • includes/admin/reporting/class-rpress-graph.php (line 232), in RPRESS_Graph::display()

See also#

Was this page helpful?