/** * Social buttons * * @since 1.6 */ public static function socialButtons() { if (is_search()) { return; } $items = Everything::to_(array(sprintf('%s/social_buttons/%s/items', get_post_type(), is_singular() ? 'single' : 'list'), sprintf('%s/social_buttons/items', get_post_type()), 'page/social_buttons/items')); if (!$items->value || !apply_filters('everything_social_buttons_display', (bool) Everything::po('layout/page/social_buttons/social_buttons', '__hidden', $items->isVisible()))) { return; } $html = is_singular() ? \Drone\HTML::section()->class('section') : \Drone\HTML::make(); foreach (array_keys($items->options) as $item) { $media['media_' . $item] = in_array($item, $items->value); } $html->add(Everything::getShortcodeOutput('social_buttons', array('size' => 'small') + $media)); echo $html->html(); }
function widget($args, $instance) { ob_start(); parent::widget($args, $instance); $output = ob_get_clean(); $output = Everything::woocommerceWidgetParseList($output); $output = preg_replace_callback('#' . '<li>' . '<a[^>]*?href="(?P<url>[^"]*)"[^>]*?>\\s*(?P<thumbnail><img[^>]*>)(?P<title>[^<>]*)</a>' . '<div[^>]*class="star-rating"[^>]*><span[^>]*><strong class="rating">(?P<average>[,\\.0-9]+)</strong>[^>]*</span></div>' . '<span class="reviewer">(?P<author>[^<>]*)</span>' . '</li>' . '#i', function ($m) { $html = \Drone\HTML::li(); $html->addNew('figure')->class('alignright fixed')->addNew('a')->attr(Everything::getImageAttrs('a', array('border' => true, 'hover' => '', 'fanbcybox' => false)))->href($m['url'])->title($m['title'])->add($m['thumbnail']); $html->addNew('h3')->addNew('a')->href($m['url'])->title($m['title'])->add($m['title']); $html->add(Everything::getShortcodeOutput('rating', array('rate' => $m['average'] . '/5', 'author' => $m['author']))); return $html->html(); }, $output); echo $output; }
if (!defined('ABSPATH')) { exit; } // ----------------------------------------------------------------------------- global $product; if (get_option('woocommerce_enable_review_rating') == 'no') { return; } ?> <?php if ($average = $product->get_average_rating()) { ?> <small class="rating" title="<?php printf(__('Rated %s out of 5', 'woocommerce'), $average); ?> "> <?php Everything::shortcodeOutput('rating', array('rate' => $average . '/5', 'advanced_tag' => '')); ?> </small> <?php } else { ?> <small class="rating"> <?php echo str_replace('icon-rating-empty', 'icon-rating-empty pad', Everything::getShortcodeOutput('rating', array('rate' => '0/5', 'advanced_tag' => ''))); ?> </small> <?php }
protected function onShortcode($content, $code, \Drone\HTML &$html) { $content = Func::wpShortcodeContent($content); $content = str_replace('<ul>', '<ul class="fancy">', $content); $content = preg_replace('#<li>(?!\\s*<i )#', '<li>' . \Everything::getShortcodeOutput('vector_icon', array('name' => $this->so('icon'), 'color' => $this->so('color') ? $this->so('color') : 'leading')), $content); $content = preg_replace('#<li>\\s*(<i[^>]*></i>)\\s*#', '<li>\\1', $content); $html->add($content); }
protected function onWidget(array $args, \Drone\HTML &$html) { if ($this->wo('description')) { $html->addNew('p')->add($this->wo_('description')->__()); } $cf = \Everything::getShortcodeOutput('contact'); $cf = str_replace('<textarea ', '<textarea class="full-width" ', $cf); $html->add($cf); }