do_shortcode( '[wppizza type="openingtimes"]' ); fails within switch_to_blog loop

WPPizza – A Restaurant Plugin for WordPress Support General Support do_shortcode( '[wppizza type="openingtimes"]' ); fails within switch_to_blog loop

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7053
    nostahl
    Participant

      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?

      #7054
      nostahl
      Participant

        upon 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

        #7057
        nostahl
        Participant

          just 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

          #7058
          Olly
          Admin & Mod
            
            $wppizzaOptions=get_option(WPPIZZA_SLUG);
            $opt=wppizza_frontendOpeningTimes($wppizzaOptions);
            echo ''.$opt.'';
            
            #7059
            nostahl
            Participant

              ty so much Olly it works beautifully now! 🙂

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The topic ‘do_shortcode( '[wppizza type="openingtimes"]' ); fails within switch_to_blog loop’ is closed to new replies.