Filter for Chart ID

Any Visualizer charts have a specific chart ID that can be rendered on the post where the chart was added. This can be done by enabling some of the Frontend Actions or adding a custom code. This article will present the second method of adding the Chart ID.

⏪ Before


⏩ After

Navigate to the active theme's functions.php file and paste the code below:

add_filter(
	'visualizer_container_attributes',
	function( $attributes, $chart_id ) {
		$attributes['data-visualizer-chart-id'] = $chart_id;
		return $attributes;
	},
	10,
	2
);

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us