/** * Full menu Shortcode * * @access public * @since 1.0.0 * @return $output shortcode output */ public function wprm_menu_full($atts, $content = null) { extract(shortcode_atts(array('category_title' => '', 'category_description' => '', 'hyperlink' => '', 'description' => '', 'price' => '', 'display_images' => ''), $atts)); ob_start(); $menu_categories = get_terms('menu_category', 'hide_empty=0'); foreach ($menu_categories as $menu_category) { $args = apply_filters('wprm_full_menu_args', array('post_type' => 'wprm_menu', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'menu_category', 'field' => 'slug', 'terms' => array($menu_category->slug))))); $menu_items = new WP_Query($args); if ($menu_items->have_posts()) { do_action('wprm_fullmenu_before'); ?> <?php if ($category_title == 'true') { ?> <h3 class="wprm_category_title"><?php echo $menu_category->name; ?> </h3> <?php } ?> <?php if ($category_description == 'true') { ?> <p class="wprm_category_description"><?php echo apply_filters('wprm_fullmenu_category_description', $menu_category->description, $menu_category->slug); ?> </p> <?php } ?> <?php while ($menu_items->have_posts()) { $menu_items->the_post(); ?> <?php get_wprm_template('shortcode-single-menu-item.php', array('hyperlink' => $hyperlink, 'description' => $description, 'price' => $price, 'display_images' => $display_images)); ?> <?php } do_action('wprm_fullmenu_after'); ?> <?php } wp_reset_postdata(); } return '<div class="wprm_shortcode wprm_category_menu wprm_full_menu wprm_single_menu_item ' . wprm_get_option('menu_style') . '">' . ob_get_clean() . '</div>'; }
/** * Widget HTML * * If you want to have an all inclusive single widget file, you can do so by * dumping your css styles with base_encoded images along with all of your * html string, right into this method. * * @param array $widget * @param array $params * @param array $sidebar */ function html($widget = array(), $params = array(), $sidebar = array()) { get_wprm_template('widget-opening-times.php', array('params' => $params)); }