コード例 #1
2
ファイル: td_block_7.php プロジェクト: Vatia13/wordpress
 function render($atts)
 {
     $this->block_uid = td_global::td_generate_unique_id();
     //update unique id on each render
     extract(shortcode_atts(array('limit' => 3, 'sort' => '', 'category_id' => '', 'category_ids' => '', 'custom_title' => '', 'custom_url' => '', 'hide_title' => '', 'show_child_cat' => '', 'tag_slug' => '', 'header_color' => ''), $atts));
     $buffy = '';
     //output buffer
     $td_unique_id = td_global::td_generate_unique_id();
     $td_query =& td_data_source::get_wp_query($atts);
     //by ref  do the query
     //get the js for this block
     $buffy .= $this->get_block_js($atts, $td_query);
     $buffy .= '<div class="td_block_wrap td_block7">';
     //get the block title
     $buffy .= $this->get_block_title($atts);
     //get the sub category filter for this block
     $buffy .= $this->get_block_sub_cats($atts, $td_unique_id);
     $buffy .= '<div id=' . $this->block_uid . ' class="td_block_inner">';
     //inner content of the block
     $buffy .= $this->inner($td_query->posts);
     $buffy .= '</div>';
     //get the ajax pagination for this block
     $buffy .= $this->get_block_pagination($atts, $td_unique_id);
     $buffy .= '</div> <!-- ./block1 -->';
     return $buffy;
 }
コード例 #2
0
ファイル: shortcodes.php プロジェクト: slavai/sadick
function tt_event_hours($atts, $content)
{
    extract(shortcode_atts(array("title" => "Event Hours", "time_format" => "H.i", "class" => "", "hour_category" => "", "text_color" => "", "border_color" => "", "columns" => ""), $atts));
    if ($hour_category != null && $hour_category != "-") {
        $hour_category = array_values(array_diff(array_filter(array_map('trim', explode(",", $hour_category))), array("-")));
    }
    if ($columns != "") {
        $weekdays_explode = explode(",", $columns);
        $weekdays_in_query = "";
        foreach ($weekdays_explode as $weekday_explode) {
            $weekdays_in_query .= "'" . $weekday_explode . "'" . ($weekday_explode != end($weekdays_explode) ? "," : "");
        }
    }
    global $wpdb;
    global $post;
    //The actual fields for data entry
    $query = "SELECT * FROM `" . $wpdb->prefix . "event_hours` AS t1 LEFT JOIN {$wpdb->posts} AS t2 ON t1.weekday_id=t2.ID \r\n\t\tWHERE t1.event_id='" . $post->ID . "'";
    if ($hour_category != null && $hour_category != "-") {
        $query .= "\r\n\t\t\tAND t1.category IN('" . join("','", $hour_category) . "')";
    }
    if ($weekdays_in_query != "") {
        $query .= " AND t2.post_name IN(" . $weekdays_in_query . ")";
    }
    $query .= " ORDER BY t2.menu_order, t1.start, t1.end";
    $event_hours = $wpdb->get_results($query);
    $event_hours_count = count($event_hours);
    if ($event_hours_count) {
        //get weekdays
        $query = "SELECT ID, post_title FROM {$wpdb->posts}\r\n\t\t\t\tWHERE \r\n\t\t\t\tpost_type='timetable_weekdays'\r\n\t\t\t\tORDER BY menu_order";
        $weekdays = $wpdb->get_results($query);
        $output = '';
        if ($title != "") {
            $output .= '<h3 class="tt_event_margin_top_27">' . $title . '<span class="tt_event_hours_count">(' . $event_hours_count . ')</span></h3>';
        }
        $output .= '
		<ul id="event_hours_list" class="timetable_clearfix tt_event_hours' . ($class != "" ? ' ' . $class : '') . '">';
        for ($i = 0; $i < $event_hours_count; $i++) {
            //get event color
            if ($border_color == "") {
                $border_color = "#" . get_post_meta($event_hours[$i]->event_id, "timetable_color", true);
            }
            //get day by id
            $current_day = get_post($event_hours[$i]->weekday_id);
            $output .= '<li' . ($border_color != "" ? ' style="border-left-color:' . $border_color . ';"' : '') . ' id="event_hours_' . $event_hours[$i]->event_hours_id . '" class="event_hours_' . ($i % 2 == 0 ? 'left' : 'right') . '"><h4' . ($text_color != "" ? ' style="color:' . $text_color . ';"' : '') . '>' . $current_day->post_title . '</h4><h4' . ($text_color != "" ? ' style="color:' . $text_color . ';"' : '') . '>' . date($time_format, strtotime($event_hours[$i]->start)) . ' - ' . date($time_format, strtotime($event_hours[$i]->end)) . '</h4>';
            if ($event_hours[$i]->before_hour_text != "" || $event_hours[$i]->after_hour_text != "") {
                $output .= '<p' . ($text_color != "" ? ' style="color:' . $text_color . ';"' : '') . ' class="tt_event_padding_bottom_0">';
                if ($event_hours[$i]->before_hour_text != "") {
                    $output .= $event_hours[$i]->before_hour_text;
                }
                if ($event_hours[$i]->after_hour_text != "") {
                    $output .= ($event_hours[$i]->before_hour_text != "" ? '<br>' : '') . $event_hours[$i]->after_hour_text;
                }
                $output .= '</p>';
            }
            $output .= '</li>';
        }
        $output .= '</ul>';
    }
    return $output;
}
コード例 #3
0
 function st_vc_single_search($attr, $content = false)
 {
     $data = shortcode_atts(array('st_list_form' => '', 'st_style_search' => 'style_1', 'st_direction' => 'horizontal', 'st_box_shadow' => 'no', 'st_search_tabs' => 'yes', 'st_title_search' => '', 'field_size' => '', 'active' => 1), $attr, 'st_single_search');
     extract($data);
     $txt = st()->load_template('vc-elements/st-single-search/search', 'form', array('data' => $data));
     return $txt;
 }
コード例 #4
0
ファイル: media.php プロジェクト: rabisahar/Spring
 protected function content($atts, $content = null)
 {
     $title = $address = $size = $zoom = $pin_image = $type = $el_position = $width = $el_class = '';
     extract(shortcode_atts(array('title' => '', 'full_width' => '', 'address' => '', 'size' => 200, 'zoom' => 14, 'pin_image' => '', 'type' => 'm', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     $output = '';
     if ($address == '') {
         return null;
     }
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $size = str_replace(array('px', ' '), array('', ''), $size);
     $map_coords = map_embed($address);
     $img_url = wp_get_attachment_image_src($pin_image, 'full');
     if ($full_width == "yes") {
         $output .= "\n\t" . '<div class="wpb_gmaps_widget full-width wpb_content_element ' . $width . $el_class . '">';
     } else {
         $output .= "\n\t" . '<div class="wpb_gmaps_widget wpb_content_element ' . $width . $el_class . '">';
     }
     $output .= "\n\t\t" . '<div class="wpb_wrapper">';
     $output .= $title != '' ? "\n\t\t\t" . '<h3 class="wpb_heading wpb_video_heading">' . $title . '</h3>' : '';
     $output .= '<div class="wpb_map_wraper"><div class="map-canvas" style="width:100%;height:' . $size . 'px;" data-address="' . $address . '" data-lat="' . $map_coords['lat'] . '" data-long="' . $map_coords['long'] . '" data-zoom="' . $zoom . '" data-maptype="' . $type . '" data-pinimage="' . $img_url[0] . '"></div></div>';
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $include_maps;
     $include_maps = true;
     return $output;
 }
コード例 #5
0
 /**
  * Columns shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_columns_shortcode($atts, $content = null)
 {
     // if ( class_exists( 'Vc_Manager' ) && function_exists( 'vc_map_get_attributes' ) ) {
     // 	$atts = vc_map_get_attributes( 'wolf_column', $atts );
     // }
     extract(shortcode_atts(array('col' => 'col-6', 'class' => '', 'first' => '', 'last' => '', 'inline_style' => ''), $atts));
     $col = esc_attr($col);
     $first = esc_attr($first);
     $last = esc_attr($last);
     $col = esc_attr($col);
     $inline_style = sanitize_text_field($inline_style);
     $output = '';
     $style = '';
     $class = $class ? "{$class} " : '';
     // add space
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     if ($first) {
         $class = 'first';
     } elseif ($last) {
         $class = 'last';
     }
     if ($class == 'first') {
         $output .= '<div class="clear"></div>';
     }
     $output .= '<div class="' . $col . ' ' . $class . '"' . $style . '>' . do_shortcode($content) . '</div>';
     if ($class == 'last') {
         $output .= '<div class="clear"></div>';
     }
     return $output;
 }
コード例 #6
0
ファイル: calltoaction.php プロジェクト: sankam-nikolya/lptt
    function calltoaction_sc($atts, $content = '')
    {
        extract(shortcode_atts(array("link" => '', "class" => '', "title" => 'Call to actions'), $atts));
        $href = '';
        if ($link) {
            $href = 'href="' . $link . '"';
        }
        $classes = "btn";
        if ($class) {
            $classes .= ' ' . $class;
        }
        $classes = 'class="' . $classes . '"';
        ob_start();
        ?>

		<div class="row">
			<div class="twelve col text-center">
				<?php 
        echo do_shortcode($content);
        ?>
				<a <?php 
        echo $href . ' ' . $classes;
        ?>
 ><?php 
        echo $title;
        ?>
</a>
			</div>
		</div>

<?php 
        $data = ob_get_clean();
        return $data;
    }
コード例 #7
0
function sc_embed_player_templater1_handler($atts)
{
    extract(shortcode_atts(array('fileurl' => '', 'autoplay' => '', 'volume' => '', 'class' => '', 'loops' => ''), $atts));
    if (empty($fileurl)) {
        return '<div style="color:red;font-weight:bold;">Compact Audio Player Error! You must enter the mp3 file URL via the "fileurl" parameter in this shortcode. Please check the documentation and correct the mistake.</div>';
    }
    if (empty($class)) {
        $class = "sc_fancy_player_container";
        //Set default container class
    }
    if (empty($autoplay)) {
        //Set autoplay value
        $autoplay = "";
    } else {
        $autoplay = "on";
    }
    if (empty($loops)) {
        //Set the loops value
        $loops = "";
    } else {
        $loops = "on";
    }
    $args = array('src' => $fileurl, 'loop' => $loops, 'autoplay' => $autoplay, 'preload' => 'none');
    $player_container = "";
    $player_container .= '<div class="' . $class . '">';
    $player_container .= wp_audio_shortcode($args);
    $player_container .= '</div>';
    return $player_container;
}
コード例 #8
0
ファイル: product_tag.php プロジェクト: ashik968/digiplot
function jigoshop_product_tag($attributes)
{
    global $paged;
    $jigoshop_options = Jigoshop_Base::get_options();
    $attributes = shortcode_atts(array('tag' => '', 'per_page' => $jigoshop_options->get('jigoshop_catalog_per_page'), 'columns' => $jigoshop_options->get('jigoshop_catalog_columns'), 'orderby' => $jigoshop_options->get('jigoshop_catalog_sort_orderby'), 'order' => $jigoshop_options->get('jigoshop_catalog_sort_direction'), 'pagination' => false, 'tax_operator' => 'IN'), $attributes);
    if (isset($_REQUEST['tag'])) {
        $attributes['tag'] = $_REQUEST['tag'];
    }
    /** Operator validation. */
    if (!in_array($attributes['tax_operator'], array('IN', 'NOT IN', 'AND'))) {
        $tax_operator = 'IN';
    }
    /** Multiple category values. */
    if (!empty($slug)) {
        $slug = explode(',', esc_attr($slug));
        $slug = array_map('trim', $slug);
    }
    $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $attributes['per_page'], 'orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'paged' => $paged, 'meta_query' => array(array('key' => 'visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN')), 'tax_query' => array(array('taxonomy' => 'product_tag', 'field' => 'slug', 'terms' => $attributes['tag'], 'operator' => $attributes['tax_operator'])));
    query_posts($args);
    ob_start();
    jigoshop_get_template_part('loop', 'shop');
    if ($attributes['pagination']) {
        do_action('jigoshop_pagination');
    }
    wp_reset_query();
    return ob_get_clean();
}
コード例 #9
0
 function do_shortcode($attrs)
 {
     $attrs = shortcode_atts(array('url' => '', 'width' => '620', 'height' => '378', 'stream' => TRUE, 'chat_width' => '620', 'chat_height' => '400', 'chat' => FALSE, 'autoplay' => TRUE), $attrs);
     if (empty($attrs['url'])) {
         return '';
     }
     $api_core = new LSB_API_Core();
     $stream_summaries = $api_core->validate_urls(array($attrs['url']));
     $stream_summary = !empty($stream_summaries) ? $stream_summaries[0] : NULL;
     /** @var $stream_summary LSB_Stream_Summary */
     if (empty($stream_summary)) {
         return '';
     }
     $view = NULL;
     switch ($stream_summary->api_id) {
         case 'twitch':
             $view = new LSB_Embedded_Twitch_View();
             break;
     }
     if (empty($view)) {
         return '';
     }
     $attrs['stream_summary'] = $stream_summary;
     return $view->get_html($attrs);
 }
コード例 #10
0
 function icon_list_item_shortcode($atts, $content = null)
 {
     $icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $icon_link = $el_class = $icon_animation = $tooltip_disp = $tooltip_text = $icon_margin = '';
     extract(shortcode_atts(array('icon_type' => 'selector', 'icon' => '', 'icon_img' => '', 'icon_color' => '#333333', 'icon_style' => 'none', 'icon_color_bg' => '#ffffff', 'icon_color_border' => '#333333', 'icon_border_style' => '', 'icon_border_size' => '1', 'icon_border_radius' => '500', 'icon_border_spacing' => '50', "icon_size" => "", "icon_margin" => "", 'el_class' => ''), $atts));
     global $vc_list_icon_size, $vc_list_icon_margin;
     if (empty($icon_size)) {
         $icon_size = $vc_list_icon_size;
     }
     if (empty($icon_margin)) {
         $icon_margin = $vc_list_icon_margin;
     }
     if ($icon_animation !== 'none') {
         $css_trans = 'data-animation="' . $icon_animation . '" data-animation-delay="03"';
     }
     $output = $style = $link_sufix = $link_prefix = $target = $href = $icon_align_style = '';
     if ($icon_margin !== '') {
         $style .= 'margin-right:' . $icon_margin . 'px;';
     }
     $icon_animation = $icon_link = '';
     $output .= '<div class="uavc-list-content">';
     if ($icon !== "" || $icon_img !== '') {
         if ($icon_type == 'custom') {
             $icon_style = 'none';
         }
         $main_icon = do_shortcode('[just_icon icon_type="' . $icon_type . '" icon="' . $icon . '" icon_img="' . $icon_img . '" img_width="' . $icon_size . '" icon_size="' . $icon_size . '" icon_color="' . $icon_color . '" icon_style="' . $icon_style . '" icon_color_bg="' . $icon_color_bg . '" icon_color_border="' . $icon_color_border . '"  icon_border_style="' . $icon_border_style . '" icon_border_size="' . $icon_border_size . '" icon_border_radius="' . $icon_border_radius . '" icon_border_spacing="' . $icon_border_spacing . '" icon_link="' . $icon_link . '" icon_animation="' . $icon_animation . '"]');
         $output .= "\n" . '<div class="uavc-list-icon ' . $el_class . '" ' . $css_trans . ' style="' . $style . '">';
         $output .= $main_icon;
         $output .= "\n" . '</div>';
     }
     $output .= '<span class="uavc-list-desc">' . do_shortcode($content) . '</span>';
     $output .= '</div>';
     $output = '<li>' . $output . '</li>';
     return $output;
 }
コード例 #11
0
ファイル: toc.php プロジェクト: elinberg/ericlinberg
function x_shortcode_toc_item($atts)
{
    extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'title' => '', 'page' => ''), $atts, 'x_toc_item'));
    $id = $id != '' ? 'id="' . esc_attr($id) . '"' : '';
    $class = $class != '' ? 'x-toc-item ' . esc_attr($class) : 'x-toc-item';
    $style = $style != '' ? 'style="' . $style . '"' : '';
    $title = $title != '' ? $title : '';
    switch ($page) {
        case 0:
            $page = '';
            break;
        case 1:
            $page = '';
            break;
        default:
            $page = $page;
            if (get_post_status(get_the_ID()) == "draft") {
                $page = '&page=' . $page;
            } else {
                $page = get_the_ID() == get_option('page_on_front') ? 'page/' . $page . '/' : $page . '/';
            }
    }
    $link = esc_url(get_permalink());
    $output = "<li {$id} class=\"{$class}\" {$style}><a href=" . $link . $page . " title=\"Go to {$title}\">" . $title . '</a></li>';
    return $output;
}
コード例 #12
0
 /**
  * @param $atts
  * @param null $content
  *
  * @return mixed|void
  */
 protected function content($atts, $content = null)
 {
     $key = '';
     /**
      * @var string $el_class
      * @var string $post_type
      * @var string $product_field_key
      * @var string $order_field_key
      * @var string $product_custom_key
      * @var string $order_custom_key
      * @var string $show_label
      * @var string $align
      */
     $atts = shortcode_atts(array('el_class' => '', 'post_type' => 'product', 'product_field_key' => 'sku', 'product_custom_key' => '', 'order_field_key' => 'order_number', 'order_custom_key' => '', 'show_label' => '', 'align' => ''), $atts);
     extract($atts);
     if ('product' === $post_type) {
         $key = '_custom_' === $product_field_key ? $product_custom_key : $product_field_key;
     } elseif ('order' === $post_type) {
         $key = '_custom_' === $order_field_key ? $order_custom_key : $order_field_key;
     }
     if ('yes' === $show_label) {
         $key .= '_labeled';
     }
     $css_class = 'vc_gitem-woocommerce vc_gitem-woocommerce-' . $post_type . '-' . $key . (strlen($el_class) ? ' ' . $el_class : '') . (strlen($align) ? ' vc_gitem-align-' . $align : '');
     return '<div class="' . esc_attr($css_class) . '">' . '{{ woocommerce_' . $post_type . ':' . $key . ' }}' . '</div>';
 }
コード例 #13
0
 /**
  * Output the shortcode.
  *
  * @param array $atts
  */
 public static function output($atts)
 {
     // Check cart class is loaded or abort
     if (is_null(WC()->cart)) {
         return;
     }
     extract(shortcode_atts(array(), $atts));
     global $post;
     if (!empty($_REQUEST['orderid']) && isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'woocommerce-order_tracking')) {
         $order_id = empty($_REQUEST['orderid']) ? 0 : esc_attr($_REQUEST['orderid']);
         $order_email = empty($_REQUEST['order_email']) ? '' : esc_attr($_REQUEST['order_email']);
         if (!$order_id) {
             echo '<p class="woocommerce-error">' . __('Please enter a valid order ID', 'woocommerce') . '</p>';
         } elseif (!$order_email) {
             echo '<p class="woocommerce-error">' . __('Please enter a valid order email', 'woocommerce') . '</p>';
         } else {
             $order = wc_get_order(apply_filters('woocommerce_shortcode_order_tracking_order_id', $order_id));
             if ($order && $order->get_id() && $order_email) {
                 if (strtolower($order->get_billing_email()) == strtolower($order_email)) {
                     do_action('woocommerce_track_order', $order->get_id());
                     wc_get_template('order/tracking.php', array('order' => $order));
                     return;
                 }
             } else {
                 echo '<p class="woocommerce-error">' . sprintf(__('Sorry, we could not find that order ID in our database.', 'woocommerce'), get_permalink($post->ID)) . '</p>';
             }
         }
     }
     wc_get_template('order/form-tracking.php');
 }
コード例 #14
0
function osc_theme_dlitem($params, $content = null)
{
    extract(shortcode_atts(array('heading' => ''), $params));
    $out = '<dt>' . do_shortcode($heading) . '</dt>';
    $out .= '<dd>' . do_shortcode($content) . '</dd>';
    return $out;
}
コード例 #15
0
/**
 * Defines [show_categories] shortcode
 *
 * @global type $cat_shortcode_query
 * @param type $atts
 * @return string
 */
function product_cat_shortcode($atts)
{
    global $cat_shortcode_query, $product_sort, $archive_template;
    $cat_shortcode_query = array();
    $cat_shortcode_query['current'] = 0;
    $args = shortcode_atts(array('exclude' => array(), 'include' => array(), 'archive_template' => get_option('archive_template', 'default'), 'parent' => '', 'sort' => 0, 'shortcode_query' => 'yes'), $atts);
    $div = '<div class="product-subcategories ' . $args['archive_template'] . ' ' . product_list_class('category-list') . '">';
    $cats = get_terms('al_product-cat', $args);
    $cat_shortcode_query['count'] = count($cats);
    $cat_shortcode_query['enable'] = $args['shortcode_query'];
    $product_sort = intval($args['sort']);
    $inside = '';
    if ($args['parent'] == '' && empty($args['include'])) {
        $old_args = $args;
        $args['parent'] = 0;
        $cats = get_terms('al_product-cat', $args);
        foreach ($cats as $cat) {
            $inside .= get_product_category_template($args['archive_template'], $cat);
            $cat_shortcode_query['current']++;
            $inside .= get_sub_product_subcategories($args, $cat);
        }
    } else {
        foreach ($cats as $cat) {
            $inside .= get_product_category_template($args['archive_template'], $cat);
            $cat_shortcode_query['current']++;
        }
    }
    if (!empty($inside)) {
        do_action('before_category_list', $archive_template);
        $inside = $div . $inside;
        $inside .= '</div>';
    }
    reset_row_class();
    return $inside;
}
コード例 #16
0
ファイル: faqs.php プロジェクト: pixelstorm/custom_shortcodes
function shortode_faqs_function($atts)
{
    $a = shortcode_atts(array('question' => 'question', 'answer' => 'answer'), $atts);
    $return_string = '<h6 class = "question">' . $a['question'] . '</h6><p class = "answer">' . $a['answer'] . '</p>';
    return $return_string;
    //$download_Label = {$a['download_Label']};
}
コード例 #17
0
 /**
  * List group.
  *
  * @param  array  $atts
  * @param  string $content
  * @return string
  */
 public function list_group($atts, $content = null)
 {
     extract(shortcode_atts(array('class' => ''), $atts));
     $content = str_replace('<ul>', '<ul class="list-group">', $content);
     $content = str_replace('<li>', '<li class="list-group-item">', $content);
     return '<div class="wabbr-list-group ' . $class . '">' . do_shortcode($content) . '</div>';
 }
コード例 #18
0
 public static function at_manufacturers($atts = null, $content = null)
 {
     if ($atts == 'generator') {
         return array("name" => __("Make", AT_ADMIN_TEXTDOMAIN), "base" => "at_manufacturers", 'icon' => "im-icon-spinner-4", "class" => "at-manufacturers-class", 'category' => __("Theme Short-Codes", AT_ADMIN_TEXTDOMAIN), "params" => array(array("type" => "textfield", "heading" => __("Title", AT_ADMIN_TEXTDOMAIN), "param_name" => "title", "value" => "", "description" => __("Enter shortcode title.", AT_ADMIN_TEXTDOMAIN), 'dependency' => array('element' => 'content_type', 'value' => array('custom_text'))), array("type" => "range", "heading" => __("Columns", AT_ADMIN_TEXTDOMAIN), "param_name" => "columns", "default" => "1", "min" => "1", "max" => "7", "step" => "1", "unit" => 'col', "description" => __("Select limit to display on this block", AT_ADMIN_TEXTDOMAIN)), array("type" => "textfield", "heading" => __("Extra class name", AT_ADMIN_TEXTDOMAIN), "param_name" => "el_class", "value" => "", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in Custom CSS Shortcode or Masterkey Custom CSS option.", AT_ADMIN_TEXTDOMAIN))));
     }
     $shortcode_id = self::_shortcode_id();
     extract(shortcode_atts(array('title' => '', 'columns' => '1', 'el_class' => ''), $atts));
     $car_model = AT_Loader::get_instance()->model('car_model');
     $manufacturers = $car_model->get_manufacturers();
     $output = '';
     if (!empty($title)) {
         $output .= '<h2>' . $title . '</h2>';
     }
     if ($columns > 1) {
         $output .= '<div class="auto-columns col-' . $columns . '">';
     }
     $output .= '<ul>';
     foreach ($manufacturers as $manufacturer) {
         $output .= '<li><a href="' . AT_Common::site_url('catalog/' . $manufacturer['alias']) . '">' . $manufacturer['name'] . '</a></li>';
     }
     $output .= '</ul>';
     if ($columns > 1) {
         $output .= '</div>';
     }
     $output .= '<div class="clear"></div>';
     return $output;
 }
コード例 #19
0
ファイル: grpdocsassembly.php プロジェクト: unisexx/drtooth
function grpdocs_assembly_getdocument($atts) {

	extract(shortcode_atts(array(
		'file' => '',
		'width' => '',
		'height' => '',
		'page' => 0,
		'version' => 1,
	), $atts));

	$guid = grpdocs_assembly_getGuid(urlencode($file));


	$no_iframe = 'If you can see this text, your browser does not support iframes. Please enable iframe support in your browser or use the latest version of any popular web browser such as Mozilla Firefox or Google Chrome. For more help, please check our documentation Wiki: <a href="http://groupdocs.com/docs/display/assembly/GroupDocs+Assembly+Integration+with+3rd+Party+Platforms">http://groupdocs.com/docs/display/assembly/GroupDocs+Assembly+Integration+with+3rd+Party+Platforms</a>';

	$code = '<iframe src="https://apps.groupdocs.com/assembly2/questionnaire-assembly/'. $guid .'?referer=wordpress-assembly/1.0.4" frameborder="0" width="'. $width .'" height="'. $height .'">' . $no_iframe . '</iframe>';

	$code = str_replace("%W%", $width, $code);
	$code = str_replace("%H%", $height, $code);
	$code = str_replace("%P%", $page, $code);
	$code = str_replace("%V%", $version, $code);
	$code = str_replace("%A%", '', $code);
	$code = str_replace("%B%", $download, $code);
	$code = str_replace("%GUID%", $guid, $code);

	return $code;

}
コード例 #20
0
function dnp_code_inline($params, $content = null)
{
    extract(shortcode_atts(array('type' => '', 'value' => ''), $params));
    $content = preg_replace('/<br class="nc".\\/>/', '', $content);
    $result = '<code>' . do_shortcode($content) . '</code>';
    return force_balance_tags($result);
}
コード例 #21
0
 /**
  * Replace the default WordPress [gallery] shortcode with a slideshow
  *
  * @param array  $attrs
  * @param string $content
  */
 public function process_shortcode($params = array(), $content = null)
 {
     // Extract parameters and provide defaults for the missing ones
     extract(shortcode_atts(array('ids' => null, 'transition' => $this->plugin->get_option(BXSG_Settings::$OPTION_DEFAULT_TRANSITION), 'exclude_featured' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_EXCLUDE_FEATURED_IMAGE), 'hide_carousel' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_HIDE_CAROUSEL), 'adaptive_height' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_ADAPTIVE_HEIGHT), 'auto_start' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_AUTO_START), 'speed' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_SPEED), 'duration' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_DURATION), 'extra_options' => $this->plugin->get_option(BXSG_Settings::$OPTION_GS_EXTRA_OPTIONS), 'shuffle' => 0, 'size' => 'full', 'thumb_size' => 'thumbnail'), $params));
     // If no ids are provided, we will take every image attached to the current post.
     // Else, we'll simply fetch them from the DB
     $ids = $ids ? explode(',', $ids) : array();
     $attachments = $this->get_attached_medias($ids, $exclude_featured);
     if ($shuffle == 1) {
         shuffle($attachments);
     }
     // Compute an ID for this particular gallery
     $gallery_id = 'bx-gallery-' . $this->current_gallery_id;
     $this->current_gallery_id += 1;
     // Build the HTML output
     ob_start();
     include BXSG_INCLUDES_DIR . '/gallery-shortcode.view.php';
     $out = ob_get_contents();
     ob_end_clean();
     // We enqueue the script for inclusion in the WordPress footer
     ob_start();
     include BXSG_INCLUDES_DIR . '/gallery-shortcode.script.php';
     $this->scripts[] = ob_get_contents();
     ob_end_clean();
     return $out;
 }
コード例 #22
0
ファイル: class-two-fifth.php プロジェクト: mathewdenis/avada
 /**
  * Render the shortcode
  * 
  * @param  array $args	 Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string		  HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     $defaults = shortcode_atts(array('class' => '', 'id' => '', 'background_color' => '', 'background_image' => '', 'background_position' => 'left top', 'background_repeat' => 'no-repeat', 'border_color' => '', 'border_size' => '', 'border_style' => 'solid', 'center_content' => 'no', 'hide_on_mobile' => 'no', 'last' => 'no', 'margin_top' => $smof_data['col_top_margin'], 'margin_bottom' => $smof_data['col_bottom_margin'], 'padding' => '', 'spacing' => 'yes', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1'), $args);
     extract($defaults);
     if ($defaults['margin_top'] == '') {
         $defaults['margin_top'] = $smof_data['col_top_margin'];
     }
     if ($defaults['margin_bottom'] == '') {
         $defaults['margin_bottom'] = $smof_data['col_bottom_margin'];
     }
     self::$args = $defaults;
     // After the last column we need a clearing div
     $clearfix = '';
     if (self::$args['last'] == 'yes') {
         $clearfix = sprintf('<div %s></div>', FusionCore_Plugin::attributes('fusion-clearfix'));
     }
     $inner_content = do_shortcode($content);
     // If content should be centered, add needed markup
     if ($center_content == 'yes') {
         $inner_content = sprintf('<div class="fusion-column-table"><div class="fusion-column-tablecell">%s</div></div>', $inner_content);
     }
     // Setup the main markup
     $html = sprintf('<div %s><div %s>%s</div></div>%s', FusionCore_Plugin::attributes('two-fifth-shortcode'), FusionCore_Plugin::attributes('two-fifth-shortcode-wrapper'), $inner_content, $clearfix);
     return $html;
 }
コード例 #23
0
    /**
     * Output the form
     *
     * @param array $atts
     */
    public static function output($atts, $content = null)
    {
        global $post, $wp;
        extract(shortcode_atts(self::options(), $atts));
        if ($content == null) {
            $content = self::content();
        }
        $current_url = add_query_arg($wp->query_string, '', home_url($wp->request));
        if (!isset($_GET['sp-unsubscribe'])) {
            ?>
<form method="post" action="<?php 
            echo home_url();
            ?>
">
			<input type="hidden" name="sendpress" value="post" />
			<input type="hidden" name="sp-shortcode" value="SC-Unsubscribe-Form" />
			<input type="hidden" name="sp-current-page" value="<?php 
            echo esc_url($current_url);
            ?>
" />
			<input type="text" name="sp-email" class="sp-input" placeholder="<?php 
            echo $placeholder;
            ?>
"/>
			<input type="submit" value="<?php 
            echo $btntxt;
            ?>
" />
			</form><?php 
        } else {
            echo do_shortcode($content);
        }
    }
コード例 #24
0
 function azuratestimonial_sc($atts, $content = "")
 {
     extract(shortcode_atts(array('id' => '', 'class' => 'pesbox', 'name' => '', 'email' => '', 'avatar' => '', 'position' => '', 'review' => '5', 'layout' => ''), $atts));
     $styleArr = shortcode_atts(array('margin_top' => '', 'margin_right' => '', 'margin_bottom' => '', 'margin_left' => '', 'border_top_width' => '', 'border_right_width' => '', 'border_bottom_width' => '', 'border_left_width' => '', 'padding_top' => '', 'padding_right' => '', 'padding_bottom' => '', 'padding_left' => '', 'border_color' => '', 'border_style' => '', 'background_color' => '', 'background_image' => '', 'background_repeat' => '', 'background_attachment' => '', 'background_size' => '', 'additional_style' => '', 'simplified' => ''), $atts);
     $styleTextArr = CthShortcodes::parseStyle($styleArr);
     $testimonialstyle = '';
     $styleText = implode(" ", $styleTextArr);
     $styleTextTest = trim($styleText);
     if (!empty($styleTextTest)) {
         $testimonialstyle .= trim($styleText);
     }
     if (!empty($testimonialstyle)) {
         $testimonialstyle = 'style="' . $testimonialstyle . '"';
     }
     $animationArgs = shortcode_atts(array('animation' => '0', 'trigger' => 'animate', 'animationtype' => '', 'animationdelay' => ''), $atts);
     $shortcodeTemp = false;
     if (stripos($layout, '_:') !== false) {
         $shortcodeTemp = JPATH_PLUGINS . '/system/cthshortcodes/shortcodes_template/' . substr($layout, 2) . '.php';
     } else {
         if (stripos($layout, ':') !== false) {
             $shortcodeTemp = CthShortcodes::templatePath() . '/html/com_azurapagebuilder/plugin/shortcodes_template/' . substr($layout, stripos($layout, ':') + 1) . '.php';
         } else {
             $shortcodeTemp = CthShortcodes::addShortcodeTemplate('azuratestimonial');
         }
     }
     $buffer = ob_get_clean();
     ob_start();
     if ($shortcodeTemp !== false) {
         require $shortcodeTemp;
     }
     $content = ob_get_clean();
     ob_start();
     echo $buffer;
     return $content;
 }
コード例 #25
0
 public function register_shortcode($atts, $content = null)
 {
     $atts = shortcode_atts(array('title' => __('Test Title', 'backend', 'vc-elements-pt'), 'number' => '299', 'icon' => 'fa fa-home'), $atts);
     $atts['number'] = absint($atts['number']);
     // The PHP_EOL is added so that it can be used as a separator between multiple counters
     return PHP_EOL . json_encode($atts);
 }
コード例 #26
0
function table_shortcode($attr)
{
    $attr = shortcode_atts(array('data' => null, 'contain' => null, 'format' => null, 'search' => false, 'rowname' => null, 'title' => null, 'subhed' => null, 'source' => null, 'sort' => '0,0', 'links' => null, 'truncate' => null, 'align' => null), $attr, 'chart');
    /* IF CHART NULL, ESCAPE */
    if ($attr['contain'] == null || $attr['data'] == null) {
        return;
    }
    /* ENCODE ATTR TO JSON */
    $encode = json_encode($attr);
    /* CALL CSS AND JS FOR SPECIFIC CHART */
    $output = '';
    $output .= '<section class="pretty-table" data="#' . $attr['contain'] . '">';
    $output .= "<script type=\"text/javascript\">var chartAttr = new Object();chartAttr = {$encode};</script>";
    /* ADD META */
    $output .= '<div class="pretty-table-meta" ></div>';
    /* ADD SEARCH IF APPLICABLE */
    if ($attr['search'] === 'true') {
        $output .= '<section id="pretty-table-search-options">';
        $output .= '<input id="pretty-table-search" type="text" style="height:24px;" placeholder="Search Table">';
        $output .= '<div><p class="pretty-table-button" id="execute-search">Search</p></div>';
        $output .= '<div><p class="pretty-table-button" id="reset-search">Reset</p></div>';
        $output .= '</section>';
    }
    $output .= '<div id="' . $attr['contain'] . '"></div></section>';
    $output .= '<script type="text/javascript">prettyTables.getAttr(chartAttr.data, chartAttr.contain, chartAttr.sort, chartAttr.search, chartAttr.title,chartAttr.subhed,chartAttr.source, chartAttr.rowname, chartAttr.format, chartAttr.links, chartAttr.truncate, chartAttr.align);</script>';
    return $output;
}
コード例 #27
0
ファイル: untappd-menu.php プロジェクト: kanei/vantuch.cz
 /**
  * [untappd-menu] shortcode.
  *
  */
 static function menu_shortcode($atts, $content = '')
 {
     // Let's bail if we don't have location or theme.
     if (!isset($atts['location']) || !isset($atts['theme'])) {
         if (current_user_can('edit_posts')) {
             return __('No location or theme ID provided in the untappd-menu shortcode.', 'jetpack');
         }
         return;
     }
     // Let's apply some defaults.
     $atts = shortcode_atts(array('location' => '', 'theme' => ''), $atts, 'untappd-menu');
     // We're going to clean the user input.
     $atts = array_map('absint', $atts);
     if ($atts['location'] < 1 || $atts['theme'] < 1) {
         return;
     }
     static $untappd_menu = 1;
     $html = '<div id="menu-container-untappd-' . $untappd_menu . '" class="untappd-menu"></div>';
     $html .= '<script type="text/javascript">' . PHP_EOL;
     $html .= '!function(e,n){var t=document.createElement("script"),a=document.getElementsByTagName("script")[0];' . PHP_EOL;
     $html .= 't.async=1,a.parentNode.insertBefore(t,a),t.onload=t.onreadystatechange=function(e,a){' . PHP_EOL;
     $html .= '(a||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t=void 0,a||n&&n())},' . PHP_EOL;
     $html .= 't.src=e}("https://embed-menu-preloader.untappdapi.com/embed-menu-preloader.min.js",function(){' . PHP_EOL;
     $html .= 'PreloadEmbedMenu( "menu-container-untappd-' . $untappd_menu . '",' . $atts["location"] . ',' . $atts["theme"] . ' )});' . PHP_EOL;
     $html .= '</script>';
     $untappd_menu++;
     return $html;
 }
コード例 #28
0
function Grafik_Shortcode_Hero_Callback($atts, $content = null)
{
    $a = shortcode_atts(array('title' => '', 'bgcolor' => '', 'bgimage' => '', 'bgsize' => 'cover', 'btnlink' => '', 'btntext' => '', 'class' => '', 'id' => ''), $atts);
    $id = "";
    if (!empty($a['id'])) {
        $id .= $a['id'];
    }
    if (!empty($id)) {
        $id = " id=\"{$id}\"";
    }
    $classes = "theme-hero";
    if (!empty($a['class'])) {
        $classes .= " {$a['class']}";
    }
    if (!empty($classes)) {
        $classes = " class=\"{$classes}\"";
    }
    $styles = "";
    if (!empty($a['bgimage'])) {
        $styles .= "background: url( {$a['bgimage']} ) no-repeat 50% 50%;";
    }
    if (!empty($a['bgcolor'])) {
        $styles .= "background-color: {$a['bgcolor']};";
    }
    if (!empty($a['bgsize'])) {
        $styles .= "background-size: {$a['bgsize']};";
    }
    if (!empty($styles)) {
        $styles = " style=\"{$styles}\"";
    }
    return '<div' . $id . $classes . $styles . '>' . '<div class="theme-hero-interior">' . '<div class="theme-hero-content">' . (empty($a['title']) ? null : '<div class="theme-hero-content-title">' . '<h2>' . $a['title'] . '</h2>' . '</div>') . '<div class="theme-hero-content-main">' . Grafik_ShortcodeLoop($content) . '</div>' . (empty($a['btntext']) || empty($a['btnlink']) ? null : '<div class="theme-hero-content-button">' . '<a href="' . $a['btnlink'] . '" title="' . $a['btntext'] . '">' . $a['btntext'] . '</a>' . '</div>') . '</div>' . '</div>' . '</div>';
}
コード例 #29
0
ファイル: slider.php プロジェクト: pronoSoupe/pronobo_soupe
function huge_it_slider_images_list_shotrcode($atts)
{
    extract(shortcode_atts(array('id' => 'no huge_it slider'), $atts));
    add_style_to_header($atts['id']);
    add_action('wp_footer', 'add_style_to_header');
    return huge_it_cat_images_list($atts['id']);
}
コード例 #30
0
 /**
  * Pre-process footnote shortcode
  *
  * @param array   $atts
  * @param string  $content
  *
  * @return string
  */
 function shortcodeHandler($atts, $content = '')
 {
     global $id;
     $a = shortcode_atts(array('numbered' => 'yes', 'symbol' => '*', 'suptext' => ' '), $atts);
     if (!$content) {
         return '';
     }
     if (!isset($this->footnotes[$id])) {
         $this->footnotes[$id] = array();
         if ($a['numbered'] == 'no') {
             $this->numbered[$id] = false;
         } else {
             $this->numbered[$id] = true;
         }
     }
     $this->footnotes[$id][] = $content;
     $footnotes = $this->footnotes[$id];
     $num = count($footnotes);
     $numlabel = "{$id}-{$num}";
     $retval = '<a class="footnote" title="' . \PressBooks\Sanitize\sanitize_xml_attribute(wp_strip_all_tags($content)) . '" id="return-footnote-' . $numlabel . '" href="#footnote-' . $numlabel . '"><sup class="footnote">[';
     if ($this->numbered[$id]) {
         $retval .= $num;
     } else {
         $retval .= $a['symbol'];
     }
     if (trim($a['suptext'])) {
         if ($this->numbered[$id]) {
             $retval .= '. ';
         }
         $retval .= $a['suptext'];
     }
     $retval .= ']</sup></a>';
     return $retval;
 }