Support » Plugin: MaxiCharts » Shortcode double quote issue in php

  • Resolved pierrethenot

    (@pierrethenot)


    Hi,
    I’m having an issue when trying to work with the shortcode directly in PHP. Here is the code I use :
    <?php echo do_shortcode(‘[gfchartsreports gf_form_id=”1″ include=”42″ height=”300px” type=”horizontalBar” maxentries=”10000″ chart_js_options=”title: {display: false}” custom_search_criteria=”{“date_start”:”22 April 1980″,”date_end”:”12 Jun 2018″}”]’); ?>

    The chart works but the date range doesn’t. It works fine if I add the shortcode directly to wordpress, but the culprit seems to come from those double quotes in the custom_search_criteria option. Do you have a solution for that?

    Regards,

    Pierre

Viewing 1 replies (of 1 total)
  • Plugin Author maxicharts

    (@maxicharts)

    Hi @pierrethenot,

    Yes the shortcode you are using cannot work : you have to replace double quotes around composite attributes (the ones containing json format – custom_search_criteria) by simple quote. Please leave double quotes inside:

    custom_search_criteria='{“date_start”:”22 April 1980″,”date_end”:”12 Jun 2018″}’

    Can you test it please ?

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode double quote issue in php’ is closed to new replies.