WPPizza – A Restaurant Plugin for WordPress › Support › General Support › do_shortcode( '[wppizza type="openingtimes"]' ); fails within switch_to_blog loop
- AuthorPosts
- 14 January, 2015 at 4:17 am #7053
working with adding opening times to a template within a switch_to_blog loop
the shortcode shows the hours fine when you are on the subdomain that the plugin is on. but if you search from another (keep in mind using the switch_to_blog loop so its running just the same as if it were local) it just outputs the shortcode in plain text.using $hours = do_shortcode( ‘[wppizza type=”openingtimes”]’ );
and then in some echo’d html I have ‘ . $hours . ‘
now I’m using this same technique for other shortcodes and it works but for some reason this opening times shortcode just displays [wppizza type=”openingtimes”] in the template wherever I try
again same technique working side by side with other shortcodes in this switch_to_blog() loop
I’m at a loss any ideas?14 January, 2015 at 4:33 am #7054upon further reading Olly,
switch_to_blog does not support plugin switching
thats the reason its failing for me… ugh
what other way do I have to get the opening times straight from the db
14 January, 2015 at 3:47 pm #7057just as an update – I still haven’t found a solution for this on my own.
how can I pull the opening times from the database without the opening times shortcode
14 January, 2015 at 7:16 pm #7058$wppizzaOptions=get_option(WPPIZZA_SLUG); $opt=wppizza_frontendOpeningTimes($wppizzaOptions); echo ''.$opt.'';
14 January, 2015 at 9:47 pm #7059ty so much Olly it works beautifully now! 🙂
- AuthorPosts
- The topic ‘do_shortcode( '[wppizza type="openingtimes"]' ); fails within switch_to_blog loop’ is closed to new replies.