当前位置: 首页>>代码示例>>PHP>>正文


PHP st_reg_shortcode函数代码示例

本文整理汇总了PHP中st_reg_shortcode函数的典型用法代码示例。如果您正苦于以下问题:PHP st_reg_shortcode函数的具体用法?PHP st_reg_shortcode怎么用?PHP st_reg_shortcode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了st_reg_shortcode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: vc_map

    vc_map(array("name" => __("ST Blog", ST_TEXTDOMAIN), "base" => "st_blog", "content_element" => true, "icon" => "icon-st", "category" => "Shinetheme", "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Style", ST_TEXTDOMAIN), "param_name" => "st_style", "value" => array(__("Style one", ST_TEXTDOMAIN) => "style1", __("Style two", ST_TEXTDOMAIN) => "style2")), array("type" => "textfield", "holder" => "div", "heading" => __("Number post", ST_TEXTDOMAIN), "param_name" => "st_blog_number_post", "value" => '4', "description" => __("Post number", ST_TEXTDOMAIN)), array("type" => "dropdown", "holder" => "div", "heading" => __("Number post of row", ST_TEXTDOMAIN), "param_name" => "st_blog_style", "value" => '', "description" => __("Number colums show in a row ", ST_TEXTDOMAIN), "value" => array(__('Four', ST_TEXTDOMAIN) => '4', __('Three', ST_TEXTDOMAIN) => '3', __('Two', ST_TEXTDOMAIN) => '2')), array("type" => "checkbox", "holder" => "div", "heading" => __("Category", ST_TEXTDOMAIN), "param_name" => "st_category", "value" => st_get_list_taxonomy_id('category')), array("type" => "dropdown", "holder" => "div", "heading" => __("Order", ST_TEXTDOMAIN), "param_name" => "st_blog_order", 'value' => array(__('Asc', ST_TEXTDOMAIN) => 'asc', __('Desc', ST_TEXTDOMAIN) => 'desc'), 'edit_field_class' => 'vc_col-sm-6', "description" => __("", ST_TEXTDOMAIN)), array("type" => "dropdown", "holder" => "div", "heading" => __("Order By", ST_TEXTDOMAIN), "param_name" => "st_blog_orderby", "value" => st_get_list_order_by(), 'edit_field_class' => 'vc_col-sm-6', "description" => __("", ST_TEXTDOMAIN)))));
}
if (!function_exists('st_vc_blog')) {
    function st_vc_blog($attr, $content = false)
    {
        $data = shortcode_atts(array('st_blog_number_post' => 5, 'st_blog_orderby' => 0, 'st_blog_order' => '', 'st_blog_style' => '', 'st_category' => '', 'st_style' => 'style1'), $attr, 'st_blog');
        extract($data);
        $query = array('post_type' => 'post', 'orderby' => $st_blog_orderby, 'order' => $st_blog_order, 'posts_per_page' => $st_blog_number_post);
        if ($st_category != '0' && $st_category != '') {
            $query['tax_query'][] = array('taxonomy' => 'category', 'terms' => explode(',', $st_category));
        }
        query_posts($query);
        $txt = '';
        while (have_posts()) {
            the_post();
            if ($st_style == 'style1') {
                $txt .= st()->load_template('vc-elements/st-blog/loop', false, $data);
            }
            if ($st_style == 'style2') {
                $txt .= st()->load_template('vc-elements/st-blog/loop2', false, $data);
            }
        }
        wp_reset_query();
        $r = '<div class="row row-wrap">
                 ' . $txt . '
               </div>';
        return $r;
    }
}
st_reg_shortcode('st_blog', 'st_vc_blog');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:30,代码来源:st-blog.php

示例2: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Alert", ST_TEXTDOMAIN), "base" => "st_alert", "content_element" => true, "icon" => "icon-st", "category" => "Shinetheme", "params" => array(array("type" => "textarea", "holder" => "div", "heading" => __("Content Alert", ST_TEXTDOMAIN), "param_name" => "st_content", "description" => "", 'edit_field_class' => 'vc_col-sm-12'), array("type" => "dropdown", "holder" => "div", "heading" => __("Type Alert", ST_TEXTDOMAIN), "param_name" => "st_type", "description" => "", 'edit_field_class' => 'vc_col-sm-12', 'value' => array(__('--Select--', ST_TEXTDOMAIN) => '', __('Success', ST_TEXTDOMAIN) => 'alert-success', __('Info', ST_TEXTDOMAIN) => 'alert-info', __('Warning', ST_TEXTDOMAIN) => 'alert-warning', __('Danger', ST_TEXTDOMAIN) => 'alert-danger')))));
}
if (!function_exists('st_vc_alert')) {
    function st_vc_alert($attr, $content = false)
    {
        $data = shortcode_atts(array('st_content' => '', 'st_type' => 'alert-success'), $attr, 'st_alert');
        extract($data);
        $txt = '<div class="alert ' . $st_type . '">
                    <button data-dismiss="alert" type="button" class="close"><span aria-hidden="true">×</span>
                    </button>
                    <p class="text-small">' . $st_content . '</p>
                </div>';
        return $txt;
    }
}
st_reg_shortcode('st_alert', 'st_vc_alert');
开发者ID:DaddyFool,项目名称:travelTest,代码行数:19,代码来源:st-alert.php

示例3: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Gird", ST_TEXTDOMAIN), "base" => "st_gird", "content_element" => true, "icon" => "icon-st", "category" => "Shinetheme", "params" => array(array("type" => "colorpicker", "holder" => "div", "heading" => __("Color", ST_TEXTDOMAIN), "param_name" => "st_color", "description" => "", 'edit_field_class' => 'vc_col-sm-12', 'value' => '#999'), array("type" => "dropdown", "holder" => "div", "heading" => __("Size", ST_TEXTDOMAIN), "param_name" => "st_size", "description" => "", 'edit_field_class' => 'vc_col-sm-12', 'value' => array(__('--Select--', ST_TEXTDOMAIN) => '', __('col-1', ST_TEXTDOMAIN) => 'col-md-1', __('col-2', ST_TEXTDOMAIN) => 'col-md-2', __('col-3', ST_TEXTDOMAIN) => 'col-md-3', __('col-4', ST_TEXTDOMAIN) => 'col-md-4', __('col-5', ST_TEXTDOMAIN) => 'col-md-5', __('col-6', ST_TEXTDOMAIN) => 'col-md-6', __('col-7', ST_TEXTDOMAIN) => 'col-md-7', __('col-8', ST_TEXTDOMAIN) => 'col-md-8', __('col-9', ST_TEXTDOMAIN) => 'col-md-9', __('col-10', ST_TEXTDOMAIN) => 'col-md-10', __('col-11', ST_TEXTDOMAIN) => 'col-md-11', __('col-12', ST_TEXTDOMAIN) => 'col-md-12')))));
}
if (!function_exists('st_vc_gird')) {
    function st_vc_gird($attr, $content = false)
    {
        $data = shortcode_atts(array('st_color' => '', 'st_size' => 'col-md-1'), $attr, 'st_gird');
        extract($data);
        $class = Assets::build_css('background : ' . $st_color . ' ; height : 20px');
        $txt = '<div class="row"><div class="demo-grid">
                    <div class="' . $st_size . '">
                        <div class="' . $class . '"></div>
                    </div>
               </div></div>';
        return $txt;
    }
}
st_reg_shortcode('st_gird', 'st_vc_gird');
开发者ID:DaddyFool,项目名称:travelTest,代码行数:20,代码来源:st-gird.php

示例4: vc_map

<?php

if (!st_check_service_available('st_holidays')) {
    return;
}
if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Detailed Holiday Gallery", ST_TEXTDOMAIN), "base" => "st_holiday_detail_photo", "content_element" => true, "icon" => "icon-st", "category" => 'Shinetheme', "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Style", ST_TEXTDOMAIN), "param_name" => "style", "description" => "", "value" => array(__('--Select--', ST_TEXTDOMAIN) => '', __('Slide', ST_TEXTDOMAIN) => 'slide', __('Grid', ST_TEXTDOMAIN) => 'grid')))));
}
if (!function_exists('st_vc_holiday_detail_photo')) {
    function st_vc_holiday_detail_photo($attr, $content = false)
    {
        $default = array('style' => 'slide');
        $attr = wp_parse_args($attr, $default);
        if (is_singular('st_holidays')) {
            return st()->load_template('holidays/elements/photo', null, array('attr' => $attr));
        }
    }
}
if (st_check_service_available('st_holidays')) {
    st_reg_shortcode('st_holiday_detail_photo', 'st_vc_holiday_detail_photo');
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:21,代码来源:st-holiday-photo.php

示例5: array

        }
        if ($st_orderby == 'sale') {
            $query['meta_key'] = 'cars_price';
            $query['orderby'] = 'meta_value';
        }
        if ($st_orderby == 'featured') {
            $query['meta_key'] = 'is_featured';
            $query['orderby'] = 'meta_value';
        }
        if (!empty($sort_taxonomy)) {
            if (isset($attr["id_term_" . $sort_taxonomy])) {
                $id_term = $attr["id_term_" . $sort_taxonomy];
                $query['tax_query'] = array(array('taxonomy' => $sort_taxonomy, 'field' => 'id', 'terms' => explode(',', $id_term)));
            }
        }
        if (!empty($st_location)) {
            $query['meta_query'][] = array('key' => 'id_location', 'value' => $st_location, 'compare' => "IN");
        }
        query_posts($query);
        $txt = '';
        while (have_posts()) {
            the_post();
            $txt .= st()->load_template('vc-elements/st-list-cars/loop', 'list', array('attr' => $attr, 'data_' => $data));
        }
        wp_reset_query();
        return '<div class="row row-wrap">' . $txt . '</div>';
    }
}
if (st_check_service_available('st_cars')) {
    st_reg_shortcode('st_list_cars', 'st_vc_list_cars');
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:st-list-cars.php

示例6: vc_map

* ST Restaurent Detail Map
* @since 1.1.0
**/
if (function_exists('vc_map')) {
    vc_map(array('name' => __('ST Detailed Hotel Map', ST_TEXTDOMAIN), 'base' => 'st_restaurent_detail_map', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Hotel', 'show_settings_on_create' => false, 'params' => array()));
}
if (!function_exists('st_restaurent_detail_map')) {
    function st_restaurent_detail_map()
    {
        if (is_singular('st_restaurent')) {
            $lat = get_post_meta(get_the_ID(), 'map_lat', true);
            $lng = get_post_meta(get_the_ID(), 'map_lng', true);
            $zoom = get_post_meta(get_the_ID(), 'map_zoom', true);
            $html = ' <div style="width:100%; height:500px;" class="st_google_map" data-type="2" data-lat="' . $lat . '"
                             data-lng="' . $lng . '"
                             data-zoom="' . $zoom . '"
                            ></div>';
            return $html;
        }
    }
}
st_reg_shortcode('st_restaurent_detail_map', 'st_restaurent_detail_map');
if (!function_exists('st_restaurent_detail_photo_func')) {
    function st_restaurent_detail_photo_func()
    {
        if (is_singular('st_restaurent')) {
            return st()->load_template('restaurent/elements/photo');
        }
    }
    st_reg_shortcode('st_restaurent_detail_photo', 'st_restaurent_detail_photo_func');
}
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:31,代码来源:restaurent.php

示例7: st_reg_shortcode

                            <img src="' . $img[0] . '" alt="Avatar" title="' . $st_name . '" />
                            <p class="testimonial-author-name" >' . $st_name . '</p>
                            <cite>' . $st_sub . '</cite>
                        </div>
                    </div>';
        }
        if ($st_style == 'style2') {
            $txt = '  <div class="testimonial style2 hidden-sm hidden-xs ' . $class_color . ' ' . $st_testimonial_color . '">
                        <div class="testimonial-inner">
                            <div class="row">
                                <div class="col-md-3">
                                     <img src="' . $img[0] . '" alt="Avatar" title="' . $st_name . '" />
                                </div>
                                <div class="col-md-8">
                                     <blockquote>
                                        <p>' . $st_desc . '</p>
                                     </blockquote>
                                </div>
                            </div>
                        </div>
                        <div class="testimonial-author">
                            <p class="testimonial-author-name dark" >' . $st_name . '</p>
                            <cite>' . $st_sub . '</cite>
                        </div>
                    </div>';
        }
        return $txt;
    }
}
st_reg_shortcode('st_testimonial', 'st_vc_testimonial');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:30,代码来源:st-testimonial.php

示例8: wp_oembed_get

        if (is_singular('st_tours')) {
            if ($video = get_post_meta(get_the_ID(), 'video', true)) {
                return "<div class='media-responsive'>" . wp_oembed_get($video) . "</div>";
            }
        }
    }
}
/**
* ST Tour Nearby
* @since 1.1.0
**/
if (function_exists('vc_map')) {
    vc_map(array('name' => __("ST Tour Nearby", ST_TEXTDOMAIN), 'base' => 'st_tour_nearby', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Tour', 'show_settings_on_create' => false, 'params' => array()));
}
if (!function_exists('st_tour_nearby')) {
    function st_tour_nearby()
    {
        if (is_singular('st_tours')) {
            return st()->load_template('tours/elements/nearby');
        }
    }
}
st_reg_shortcode('st_tour_nearby', 'st_tour_nearby');
st_reg_shortcode('st_tour_video', 'st_tour_video');
st_reg_shortcode('st_tour_price', 'st_tour_price');
st_reg_shortcode('st_tour_review', 'st_tour_review');
st_reg_shortcode('st_tour_detail_list_schedules', 'st_tour_detail_list_schedules');
st_reg_shortcode('st_tour_detail_review_detail', 'st_tour_detail_review_detail');
st_reg_shortcode('st_tour_detail_review_summary', 'st_tour_detail_review_summary');
st_reg_shortcode('st_tour_detail_map', 'st_tour_detail_map');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:30,代码来源:tour.php

示例9: st_post_data

    function st_post_data($attr = array())
    {
        $default = array('field' => 'title', 'post_id' => false);
        extract(wp_parse_args($attr, $default));
        if (!$post_id and is_single()) {
            $post_id = get_the_ID();
        }
        if ($post_id and is_single()) {
            switch ($field) {
                case "content":
                    $post = get_post($post_id);
                    $content = $post->post_content;
                    $content = apply_filters('the_content', $content);
                    $content = str_replace(']]>', ']]&gt;', $content);
                    return $content;
                    break;
                case "excerpt":
                    $post = get_post($post_id);
                    if (isset($post->post_excerpt)) {
                        return $post->post_excerpt;
                    }
                    break;
                case "title":
                    return get_the_title($post_id);
                    break;
            }
        }
    }
}
st_reg_shortcode('st_post_data', 'st_post_data');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:30,代码来源:post.php

示例10: get_the_title

                        $data_map[$stt]['name'] = get_the_title();
                        $data_map[$stt]['post_type'] = $post_type;
                        $data_map[$stt]['lat'] = $map_lat;
                        $data_map[$stt]['lng'] = $map_lng;
                        if ($post_type == 'st_hotel') {
                            $data_map[$stt]['icon_mk'] = st()->get_option('st_hotel_icon_map_marker', 'http://maps.google.com/mapfiles/marker_yellow.png');
                        } else {
                            $data_map[$stt]['icon_mk'] = st()->get_option('st_rental_icon_map_marker', 'http://maps.google.com/mapfiles/marker_yellow.png');
                        }
                        $data_map[$stt]['content_html'] = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', st()->load_template('vc-elements/st-list-map/loop/room', false, array('hotel_id' => $hotel_id)));
                        $data_map[$stt]['content_adv_html'] = preg_replace('/^\\s+|\\n|\\r|\\s+$/m', '', st()->load_template('vc-elements/st-list-map/loop-adv/room', false, array('hotel_id' => $hotel_id)));
                        $stt++;
                    }
                }
                wp_reset_postdata();
            }
            if ($location_center == '[,]') {
                $location_center = '[0,0]';
            }
            if ($show_circle == 'no') {
                $range = 0;
            }
            $data_tmp = array('location_center' => $location_center, 'zoom' => $zoom, 'data_map' => $data_map, 'height' => 500, 'style_map' => 'normal', 'number' => $number, 'range' => $range, 'hotel_id' => $hotel_id);
            $data_tmp['data_tmp'] = $data_tmp;
            $html = '<div class="map_single">' . st()->load_template('hotel/elements/detail', 'map', $data_tmp) . '</div>';
            return $html;
        }
    }
}
st_reg_shortcode('st_room_map', 'st_room_map_fc');
开发者ID:DaddyFool,项目名称:travelTest,代码行数:30,代码来源:st-map-room.php

示例11: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Rental Attribute", ST_TEXTDOMAIN), "base" => "st_rental_attribute", "content_element" => true, "icon" => "icon-st", "category" => 'Shinetheme', "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Select Taxonomy", ST_TEXTDOMAIN), "param_name" => "taxonomy", "description" => "", "value" => st_list_taxonomy('st_rental')), array("type" => "dropdown", "holder" => "div", "heading" => __("Item Size", ST_TEXTDOMAIN), "param_name" => "item_col", "description" => "", "value" => array(2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12)))));
}
if (!function_exists('st_vc_rental_attribute')) {
    function st_vc_rental_attribute($attr, $content = false)
    {
        if (is_singular('st_rental')) {
            return st()->load_template('rental/elements/attribute', null, array('attr' => $attr));
        }
    }
}
st_reg_shortcode('st_rental_attribute', 'st_vc_rental_attribute');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:14,代码来源:st-rental-attribute.php

示例12: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Activity Search Results", ST_TEXTDOMAIN), "base" => "st_activiry_content_search", "content_element" => true, "icon" => "icon-st", "category" => 'Shinetheme', "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Style", ST_TEXTDOMAIN), "param_name" => "st_style", "description" => "", "value" => array(__('Style 1 ', ST_TEXTDOMAIN) => '1', __('Style 2 ', ST_TEXTDOMAIN) => '2')))));
}
if (!function_exists('st_vc_activiry_content_search')) {
    function st_vc_activiry_content_search($attr, $content = false)
    {
        return st()->load_template('activity/content', 'activity', array('attr' => $attr));
    }
}
st_reg_shortcode('st_activiry_content_search', 'st_vc_activiry_content_search');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:12,代码来源:st-activity-content-search.php

示例13: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Cars Attribute", ST_TEXTDOMAIN), "base" => "st_cars_attribute", "content_element" => true, "icon" => "icon-st", "category" => "Shinetheme", "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Select Taxonomy", ST_TEXTDOMAIN), "param_name" => "taxonomy", "description" => "", "value" => st_list_taxonomy('st_cars')), array("type" => "textfield", "holder" => "div", "heading" => __("Title", ST_TEXTDOMAIN), "param_name" => "title", "description" => ""))));
}
if (!function_exists('st_vc_cars_attribute')) {
    function st_vc_cars_attribute($attr, $content = false)
    {
        if (is_singular('st_cars')) {
            return st()->load_template('cars/elements/attribute', null, array('attr' => $attr));
        }
    }
}
st_reg_shortcode('st_cars_attribute', 'st_vc_cars_attribute');
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:14,代码来源:st-cars-attribute.php

示例14: vc_map

 * Car review summary (like hotel)
 */
if (function_exists('vc_map')) {
    vc_map(array('name' => __("ST Car  detail review summary", ST_TEXTDOMAIN), 'base' => 'st_car_detail_review_summary', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Car', 'show_settings_on_create' => false, 'params' => array()));
}
if (!function_exists('st_car_detail_review_summary')) {
    function st_car_detail_review_summary()
    {
        if (is_singular('st_cars')) {
            return st()->load_template('cars/elements/review_summary');
        }
    }
}
st_reg_shortcode('st_car_detail_review_summary', 'st_car_detail_review_summary');
/**
 * ST Cars Detail Review Detail
 * @since 1.1.0
 **/
if (function_exists('vc_map')) {
    vc_map(array('name' => __('ST Car Show Discount', ST_TEXTDOMAIN), 'base' => 'st_car_show_discount', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Car', 'show_settings_on_create' => false, 'params' => array()));
}
if (!function_exists('st_car_show_discount')) {
    function st_car_show_discount()
    {
        if (is_singular('st_cars')) {
            return st()->load_template('cars/elements/car_show_info_discount');
        }
    }
}
st_reg_shortcode('st_car_show_discount', 'st_car_show_discount');
开发者ID:DaddyFool,项目名称:travelTest,代码行数:30,代码来源:cars.php

示例15: vc_map

<?php

if (function_exists('vc_map')) {
    vc_map(array("name" => __("ST Flickr", ST_TEXTDOMAIN), "base" => "st_flickr", "content_element" => true, "icon" => "icon-st", "params" => array(array("type" => "textfield", "heading" => __("Number", ST_TEXTDOMAIN), "param_name" => "st_number", "description" => ""), array("type" => "textfield", "heading" => __("User", ST_TEXTDOMAIN), "param_name" => "st_user", "description" => ""))));
}
if (!function_exists('st_vc_flickr')) {
    function st_vc_flickr($arg, $content = false)
    {
        $data = shortcode_atts(array('st_number' => 5, 'st_user' => '23401669@N00'), $arg, 'st_flickr');
        extract($data);
        $r = st()->load_template('vc-elements/st-fickr/html', null, $data);
        return $r;
    }
}
st_reg_shortcode('st_flickr', 'st_vc_flickr');
开发者ID:DaddyFool,项目名称:travelTest,代码行数:15,代码来源:st-fickr.php


注:本文中的st_reg_shortcode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。