/** * Remove YIT Shortcodes button in YITH Themes * * @author Andrea Grillo <*****@*****.**> * * @return void * @since 1.6 */ public function remove_shortcodes_button() { if (function_exists('YIT_Shortcodes')) { $vendor = yith_get_vendor('current', 'user'); $disabled_yit_shortcodes = 'no' == get_option('yith_wpv_yit_shortcodes', 'no') ? true : false; if ($vendor->is_valid() && $vendor->has_limited_access() && $disabled_yit_shortcodes) { remove_action('admin_init', array(YIT_Shortcodes(), 'add_shortcodes_button')); } } }
$i = 1; foreach ($twitter_data as $tweet) { if (!empty($tweet)) { $text = $tweet->text; $text_in_tooltip = str_replace('"', '', $text); // replace " to avoid conflicts with title="" opening tags $id = $tweet->id; $time = yit_get_date_diff($tweet->created_at); //strftime('%d/%m/%Y %H:%M:%S', strtotime($tweet->created_at)); $username = $tweet->user->name; } echo '<li class="tweet_' . $i . '"><div class="icon-container"><i class="fa fa-twitter"></i></div><div class="text-container"><p><span class="text">' . $text . '</span> '; if ($show_time == 'true') { echo '<span class="meta">' . $time . '</span>'; } echo '</p></div><div class="clear"></div></li>'; ?> <?php $i++; } echo '</ul>'; ?> </div> <?php } ?> <?php wp_enqueue_script('shortcode_twitter', YIT_Shortcodes()->plugin_assets_url . '/js/twitter-text.js', array('jquery'), '', true); wp_enqueue_script('yit_shortcode', YIT_Shortcodes()->plugin_assets_url . '/js/twitter.min.js', array('jquery', 'shortcode_twitter'), '', true);
break; case "external" : $link['url'] = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) ); $link['label'] = apply_filters( 'external_add_to_cart_text', __( 'Read More', 'yit' ) ); break; default : if ( $product->is_purchasable() ) { $link['url'] = apply_filters( 'add_to_cart_url', esc_url( $product->add_to_cart_url() ) ); $link['label'] = apply_filters( 'add_to_cart_text', __( 'Add to cart', 'yit' ) ); $link['quantity'] = apply_filters( 'add_to_cart_quantity', ( get_post_meta( $product->id, 'minimum_allowed_quantity', true ) ? get_post_meta( $product->id, 'minimum_allowed_quantity', true ) : 1 ) ); } else { $link['url'] = apply_filters( 'not_purchasable_url', get_permalink( $product->id ) ); $link['label'] = apply_filters( 'not_purchasable_text', __( 'Read More', 'yit' ) ); } break; } echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-quantity="%s" data-product_sku="%s" class="%s product_type_%s">%s</a>', esc_url( $link['url'] ), esc_attr( $product->id ), esc_attr( $link['quantity'] ), esc_attr( $product->get_sku() ), esc_attr( $link['class'] ), esc_attr( $product->product_type ), esc_html( $link['label'] ) ), $product, $link ); endif; if ( $woocommerce_loop['products_layout'] != 'alternative' && yit_get_option( 'shop-quick-view-enable' ) == 'yes' && ( ( YIT_Mobile()->isMobile() && YIT_Mobile()->is( 'iPad' ) ) || ! YIT_Mobile()->isMobile() ) && ! $is_wishlist ) { $sc_index = function_exists('YIT_Shortcodes') && YIT_Shortcodes()->is_inside ? '-' . YIT_Shortcodes()->index() : ''; echo '<a id="quick-view-trigger-' . esc_attr( $product->id ) . $sc_index . '" href="#" class="trigger-quick-view btn-ghost" data-item_id="'. $product->id . '"><span class="fa fa-search"></span></a>'; } ?> </div>
function woocommerce_template_loop_product_thumbnail() { global $product, $yit_products_layout, $woocommerce_loop; $attachments = $product->get_gallery_attachment_ids(); $original_size = wc_get_image_size('shop_catalog'); if ($woocommerce_loop['view'] == 'masonry_item') { $size = $original_size; $size['height'] = 0; YIT_Registry::get_instance()->image->set_size('shop_catalog', $size); } echo '<div class="thumb-wrapper ' . $yit_products_layout . '">'; switch ($yit_products_layout) { case 'slideup': echo '<a href="' . get_permalink() . '" class="thumb">' . woocommerce_get_product_thumbnail() . '</a>'; echo '<div class="quick-view' . (yit_get_option('shop-use-quick-view') == 'no' ? ' none' : '') . '" data-product_id="' . esc_attr($product->id) . '">'; if (yit_get_option('shop-use-quick-view') == 'yes') { $sc_index = function_exists('YIT_Shortcodes') && YIT_Shortcodes()->is_inside ? '-' . YIT_Shortcodes()->index() : ''; echo '<a id="quick-view-trigger-' . esc_attr($product->id) . $sc_index . '" href="#" class="trigger" data-item_id="' . $product->id . '">+ ' . yit_get_option('shop-quick-view-text') . '</a>'; } elseif (yit_get_option('shop-add-to-cart') == 'yes') { if (!$product->is_in_stock()) { echo '<p>' . __('Out of stock', 'yit') . '</p>'; } elseif ($product->product_type == 'simple') { echo '<p>' . yit_get_option('shop-add-to-cart-text') . '</p>'; } elseif ($product->product_type == 'grouped' || $product->product_type == 'variable') { echo '<p>' . __('View options', 'yit') . '</p>'; } else { echo '<p>' . __('Read more', 'yit') . '</p>'; } } do_action('yith_add_to_cart_button'); echo '</div>'; break; case 'classic': if (isset($attachments[0])) { echo '<a href="' . get_permalink() . '" class="thumb backface"><span class="face">' . woocommerce_get_product_thumbnail() . '</span>'; echo '<span class="face back">'; yit_image("id={$attachments['0']}&size=shop_catalog&class=image-hover"); echo '</span></a>'; } else { echo '<a href="' . get_permalink() . '" class="thumb"><span class="face">' . woocommerce_get_product_thumbnail() . '</span></a>'; } break; } echo '</div>'; if ($woocommerce_loop['view'] == 'masonry_item') { YIT_Registry::get_instance()->image->set_size('shop_catalog', $original_size); } }
function yit_shop_loop_add_to_cart() { global $product; echo '<div class="product-action-button-wrapper">'; wc_get_template( 'loop/add-to-cart.php' ); if( yit_get_option( 'shop-quick-view-enable' ) == 'yes' && ( ( YIT_Mobile()->isMobile() && YIT_Mobile()->is( 'iPad' ) ) || ! YIT_Mobile()->isMobile() ) ) { $sc_index = function_exists('YIT_Shortcodes') && YIT_Shortcodes()->is_inside ? '-' . YIT_Shortcodes()->index() : ''; echo '<a id="quick-view-trigger-' . esc_attr( $product->id ) . $sc_index . '" href="#" class="trigger-quick-view" data-item_id="'. $product->id . '"><span class="fa fa-search"></span></a>'; } echo '</div>'; }
$width = '100%'; } else { $width = $width . 'px'; } $height = $height == '0' ? '100%' : $height . 'px'; echo '<div class="images-slider-sc ' . esc_attr($vc_css) . '" style="width:' . $width . '; height:' . $height . '" data-effect="' . $effect . '" data-speed="' . $speed . '" data-direction="' . $direction . '">'; echo '<ul class="slides">'; $i = 0; foreach ($urls as $url) { $host = $a_before = $a_after = ''; if (preg_match('%^(?=[^&])(?:(?<scheme>[^:/?#]+):)?(?://(?<authority>[^/?#]*))?(?<path>[^?#]*)(?:\\?(?<query>[^#]*))?(?:#(?<fragment>.*))?%', $url, $matches)) { if (empty($matches[1])) { $url = site_url() . '/' . $matches[3]; } else { $url = $matches[0]; } } $url = str_replace('<br />', '', $url); $url = str_replace(array('<p>', '</p>'), '', $url); if ($url != '') { echo '<li><img style="max-width:100%" src="' . $host . $url . '" alt="' . $i . '" /></li>'; } $i++; } echo '</ul></div>'; wp_register_script('yit_flexslider', YIT_Shortcodes()->plugin_assets_url . '/js/flexslider.min.js', array('jquery'), '', true); wp_register_script('yit_images_slider', YIT_Shortcodes()->plugin_assets_url . '/js/images-slider.min.js', array('jquery', 'yit_flexslider'), '', true); wp_localize_script('yit_images_slider', 'yit_images_slider_params', array('effect' => $effect, 'direction' => $direction, 'speed' => $speed)); wp_enqueue_script('yit_images_slider'); add_action('wp_enqueue_scripts', array(YIT_Shortcodes(), 'add_handler_images_slider'), 30);
?> " alt="" width="78" height="78" /> <span class="shortcode-title"><?php echo $atts['title']; ?> </span> <input type="hidden" name="shortcode[<?php echo $shortcode; ?> ]" value='<?php echo YIT_Shortcodes()->shortcode_print_code($shortcode); ?> ' /> </div> <?php echo YIT_Shortcodes()->shortcode_print_form($shortcode); ?> <?php $tabs[] = $atts['tab']; ?> <?php } ?> <?php } ?> </div> <div id="shortcode-tab"> <ul id="sidemenu"> <?php
echo intval(get_comment_meta($review->comment_ID, 'rating', true)) / 5 * 100; ?> %"><strong itemprop="ratingValue"><?php echo intval(get_comment_meta($review->comment_ID, 'rating', true)); ?> </strong> <?php _e('out of 5', 'woocommerce'); ?> </span> </span> <?php } ?> </p> <div class="clear"></div> </div> <div class="clear"></div> </li> <?php } ?> </ul> </div> <?php wp_register_script('yit_flexslider', YIT_Shortcodes()->plugin_assets_url . '/js/flexslider.min.js', array('jquery'), '', true); wp_register_script('yit_review_slider', YIT_Shortcodes()->plugin_assets_url . '/js/review-slider.min.js', array('jquery', 'yit_flexslider'), '', true); wp_localize_script('yit_review_slider', 'yit_review_slider_params', array('slideshowSpeed' => isset($timeout) ? $timeout : 3000, 'animationSpeed' => isset($speed) ? $speed : 400)); wp_enqueue_script('yit_review_slider');
function yit_add_quick_view_button() { if (YIT_Mobile()->isMobile()) { return; } global $product; echo '<div class="product-quick-view-button">'; $sc_index = function_exists('YIT_Shortcodes') && YIT_Shortcodes()->is_inside ? '-' . YIT_Shortcodes()->index() : ''; echo '<a id="quick-view-trigger-' . esc_attr($product->id) . $sc_index . '" href="#" class="trigger-quick-view" data-item_id="' . $product->id . '">' . __(yit_get_option('shop-quick-view-text'), 'yit') . '</a>'; echo '</div>'; }
/** * Return an array with all testimonial categories * * All testimonial categories in an array, the first element of array is a general item * that is useful to show all categories * * @param $atts * @param string $content * @param $shortcode * * @return array * @since 1.0 * @author Emanuela Castorina <*****@*****.**> * @author Francesco Licandro <*****@*****.**> */ public function add_shortcode($atts, $content = "", $shortcode) { $all_atts = $atts; $all_atts['content'] = $content; if (defined('YIT_SHORTCODE')) { $shortcodes = YIT_Shortcodes()->shortcodes; } else { $shortcodes = $this->shortcodes_hook(); } if (isset($shortcodes[$shortcode]['unlimited']) && $shortcodes[$shortcode]['unlimited']) { $atts['content'] = $content; } else { //retrieves default atts $default_atts = array(); if (!empty($shortcodes[$shortcode]['attributes'])) { foreach ($shortcodes[$shortcode]['attributes'] as $name => $type) { $default_atts[$name] = isset($type['std']) ? $type['std'] : ''; if (isset($atts[$name]) && $type['type'] == "checkbox") { if ($atts[$name] == 1 || $atts[$name] == 'yes') { $atts[$name] = 'yes'; } else { $atts[$name] = 'no'; } } } } // // if ( ! empty( $shortcodes[$shortcode]['attributes'] ) ) { // foreach ( $shortcodes[$shortcode]['attributes'] as $name => $type ) { // $default_atts[$name] = isset( $type['std'] ) ? $type['std'] : ''; // } // } //combines with user attributes $atts = shortcode_atts($default_atts, $atts); } // remove validate attrs foreach ($atts as $att => $v) { unset($all_atts[$att]); } $atts['content'] = $content; 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); }
vc_remove_element( 'vc_cta_button' ); vc_remove_element( 'vc_cta_button2' ); vc_remove_element( 'vc_video' ); vc_remove_element( 'vc_gmaps' ); vc_remove_element( 'vc_flickr' ); vc_remove_element( 'vc_progress_bar' ); vc_remove_element( 'vc_pie' ); vc_remove_element( 'vc_toggle' ); vc_remove_element( 'vc_tabs' ); vc_remove_element( 'vc_empty_space' ); vc_remove_element( 'vc_custom_heading' );*/ } } /** * Main instance of plugin * * @return object * @since 1.0 * @author Emanuela Castorina <*****@*****.**> */ function YIT_Shortcodes() { return YIT_Shortcodes::instance(); } /** * Create a new YIT_Plugin_Shortcodes object */ YIT_Shortcodes();