Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Shortcode in Javascript | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Shortcode in Javascript

Shortcode in Javascript

Posted: May 21, 2013 at 5:52 pm

Viewing 4 reply threads


Hansteen

May 21, 2013 at 5:52 pm

I would like to have a  drop-down menu that uses javascript to allow users to select a category to display in the calendar, but I’m not sure how to call the calendar shortcode in the javascript. Is this possible? Thanks.


Dean

  • Support Staff

May 22, 2013 at 12:59 am

Hello,

You would need to use AJAX to call the PHP function that does whatever you need.

http://codex.wordpress.org/AJAX

It is likely that you will need to use the do_shortcode() function within the PHP code block as well.

http://codex.wordpress.org/do_shortcode

As the calendar is made in javascript I would also advise you to take a look at the base files, which can be found here http://arshaw.com/fullcalendar/docs/


Hansteen

May 22, 2013 at 10:47 am

Thanks. Before I get into the AJAX, I seem to be having trouble even getting a calendar to show up when I use a custom template. Is the following the correct way to insert a calendar into a template file:

echo do_shortcode(‘[ESPRESSO_CALENDAR cal_view=”basicWeek”]’);


Josh

May 22, 2013 at 11:17 am

That should work as long as it’s within a PHP block. If it’s not in a PHP block, it would be:

<php echo do_shortcode('[ESPRESSO_CALENDAR cal_view="basicWeek"]'); ?>


Hansteen

May 22, 2013 at 12:40 pm

Thanks!

Viewing 4 reply threads

The support post ‘Shortcode in Javascript’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server