plugins – Dynamically add data to amCHARTS in a custom post type


I’m looking for a way to add a chart (created with amCHARTS) to a post of a custom post type and that chart is loaded with data from a custom fields.

And I added a filter to pass the custom post type data to the chart, but the problem is that I don’t know how to associate that filter to the chart (ID = “CC-CM”).

function apply_amcharts_shortcode_data( $output, $atts, $post_id ) {
  // Load your data here
  $calidad_muscular = get_post_meta( $post_id, 'calidad_muscular', true );

  // Add to the output
  $output['score'] = $calidad_muscular
  return $output;
add_filter( 'amcharts_shortcode_data', 'apply_amcharts_shortcode_data' );

I don’t know if I’ll be on the right track.

Manuel Hermida 3 months 2021-07-14T16:00:57-05:00 0 Answers 0 views 0

Leave an answer