'operator' => 'IN' ) ) ); $products = new WP_Query( $args ); if (count($products->posts) > 0) { $category_link = get_term_link( $category, 'product_cat' ); $sitemap['products'] .= '<h4><a href="'. $category_link .'">' . $category->name . '</a></h4>'; $sitemap['products'] .= '<ul class="cat_' . $category->term_id .' cat">'; foreach($products->posts as $post) { $sitemap['products'] .= '<li><a href="' . get_permalink($post->ID) . '" title="' . sprintf(esc_attr__('Permalink to %s', 'yit'), the_title_attribute('echo=0')) . '" rel="bookmark">' . get_the_title($post->ID) . '</a></li>'; } if( YIT_Sitemap()->get_option( 'sitemap-product-items' ) ) { $sitemap['products'] .= '<li class="sitemap-read-more"><a href="' . $category_link . '">' . __('More', 'yit') . '</a></li>'; } $sitemap['products'] .= '</ul>'; } } } } //print the sitemap $i = 0; foreach($order as $k => $item) { $class = ( $i++ % $columns ) == 0 ? ' first' : '';
} //combines with user attributes $atts = shortcode_atts($default_atts, $atts); $atts['content'] = $content; } // remove validate attrs foreach ($atts as $att => $v) { unset($all_atts[$att]); } ob_start(); yit_plugin_get_template($this->plugin_path, 'shortcodes/' . $shortcode . '.php', $atts); $shortcode_html = ob_get_clean(); return apply_filters('yit_shortcode_' . $shortcode, $shortcode_html, $shortcode); } } /** * Main instance of plugin * * @return object * @since 1.0 * @author Antonio La Rocca <*****@*****.**> */ function YIT_Sitemap() { return YIT_Sitemap::instance(); } /** * Create a new YIT_Sitemap object */ YIT_Sitemap();