本文整理汇总了PHP中st函数的典型用法代码示例。如果您正苦于以下问题:PHP st函数的具体用法?PHP st怎么用?PHP st使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了st函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: st_vc_list_rental
function st_vc_list_rental($attr, $content = false)
{
$data = shortcode_atts(array('st_ids' => '', 'taxonomy' => '', 'number' => 0, 'st_order' => '', 'st_orderby' => '', 'number_of_row' => 4, 'st_location' => ''), $attr, 'st_list_rental');
extract($data);
$query = array('post_type' => 'st_rental', 'posts_per_page' => $number, 'order' => $st_order, 'orderby' => $st_orderby);
if (!empty($st_ids)) {
$query['post__in'] = explode(',', $st_ids);
}
if ($st_orderby == 'sale') {
$query['meta_key'] = 'price';
$query['orderby'] = 'meta_value';
}
if ($st_orderby == 'featured') {
$query['meta_key'] = 'cars_set_as_featured';
$query['orderby'] = 'meta_value';
}
if (!empty($st_location)) {
$query['meta_query'] = array('key' => 'id_location', 'value' => $st_location, 'compare' => "=");
}
$current_page = get_post_type(get_the_ID());
// get current page .since 1.1.3
query_posts($query);
$txt = '';
while (have_posts()) {
the_post();
$txt .= st()->load_template('vc-elements/st-list-rental/loop', 'list', array('attr' => $attr, 'data' => $data, 'current_page' => $current_page));
}
wp_reset_query();
return '<div class="row row-wrap">' . $txt . '</div>';
}
示例2: widget
public function widget($args, $instance)
{
$cache = array();
if (!$this->is_preview()) {
$cache = wp_cache_get($this->cache_key, 'widget');
}
if (!is_array($cache)) {
$cache = array();
}
if (!isset($args['widget_id'])) {
$args['widget_id'] = $this->id;
}
if (isset($cache[$args['widget_id']])) {
echo balanceTags($cache[$args['widget_id']]);
return;
}
ob_start();
$default = array('title' => 'Filter By:', 'show_attribute' => '', 'st_search_fields' => '', 'style' => 'dark');
$instance = wp_parse_args($instance, $default);
echo st()->load_template('rental/filter', null, array('instance' => $instance));
if (!$this->is_preview()) {
$cache[$args['widget_id']] = ob_get_flush();
wp_cache_set($this->cache_key, $cache, 'widget');
} else {
ob_end_flush();
}
}
示例3: 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;
}
示例4: st_vc_single_search
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;
}
示例5: st_search_rental_result
function st_search_rental_result($arg = array())
{
if (!get_post_type() == 'st_rental' and get_query_var('post_type') != "st_rental") {
return;
}
return st()->load_template('rental/search-elements/result', false, array('arg' => $arg));
}
示例6: st_list_hotel_related
function st_list_hotel_related($attr, $content = false)
{
$data_vc = STHotel::get_taxonomy_and_id_term_tour();
$param = array('title' => '', 'sort_taxonomy' => '', 'posts_per_page' => 3, 'orderby' => 'ID', 'order' => 'DESC', 'font_size' => '3', 'number_of_row' => 1);
$param = array_merge($param, $data_vc['list_id_vc']);
$data = shortcode_atts($param, $attr, 'st_list_hotel_related');
extract($data);
$page = STInput::request('paged');
if (!$page) {
$page = get_query_var('paged');
}
$query = array('post_type' => 'st_hotel', 'posts_per_page' => $posts_per_page, 'post_status' => 'publish', 'paged' => $page, 'order' => $order, 'orderby' => $orderby, 'post__not_in' => array(get_the_ID()));
if (!empty($sort_taxonomy)) {
if (isset($attr["id_term_" . $sort_taxonomy])) {
$terms_post = wp_get_post_terms(get_the_ID(), $sort_taxonomy, array('fields' => 'ids'));
$id_term = $attr["id_term_" . $sort_taxonomy];
$id_term = explode(',', $id_term);
$terms = array();
foreach ($id_term as $key => $value) {
if (in_array($value, $terms_post)) {
$terms[] = $value;
}
}
if ($terms) {
$query['tax_query'] = array(array('taxonomy' => $sort_taxonomy, 'field' => 'id', 'terms' => $terms));
}
}
}
$r = "<div class='list_hotel_related'>" . st()->load_template('vc-elements/st-list-hotel/loop-hot', 'deals', array('query' => new Wp_Query($query))) . "</div>";
wp_reset_query();
if (!empty($title) and !empty($r)) {
$r = '<h' . $font_size . '>' . $title . '</h' . $font_size . '>' . $r;
}
return $r;
}
示例7: widget
public function widget($args, $instance)
{
$title = apply_filters('widget_title', $instance['title']);
$args['after_title'] = apply_filters('after_title_widget_location', $args['after_title']);
$args['before_title'] = apply_filters('before_title_widget_location', $args['before_title']);
$args['before_widget'] = apply_filters('before_widget_location', $args['before_widget']);
$args['after_widget'] = apply_filters('after_widget_location', $args['after_widget']);
$post_type = $instance['post_type'] ? $instance['post_type'] : "st_cars";
echo balancetags($args['before_widget']);
if (!empty($title)) {
echo balancetags($args['before_title'] . $title . $args['after_title']);
}
$post_type = $instance['post_type'] ? $instance['post_type'] : "st_cars";
$array = STLocation::get_info_by_post_type(get_the_ID(), $post_type);
$array['title'] = $instance['title'] ? $instance['title'] : "";
$array['post_type'] = $instance['post_type'];
if (!isset($instance['use_feature']) || $instance['use_feature'] == "feature") {
$post_id = STLocation::get_random_post_type(get_the_ID(), $instance['post_type']);
$array['thumb'] = get_post_thumbnail_id($post_id);
} else {
$array['thumb'] = $instance['background'] ? $instance['background'] : "";
}
echo st()->load_template('location/location-content-item', null, $array);
echo balancetags($args['after_widget']);
}
示例8: _enqueue_data
static function _enqueue_data()
{
//'Most recent booking for this property was 15 minute ago .Most recent booking for this property was 15 minute ago'
if (!self::$is_working) {
return;
}
$data = array();
if (is_singular()) {
$post_type = get_post_type();
$book_able = array('st_hotel', 'st_cars', 'st_tours', 'st_activity', 'st_rental', 'cruise');
if (!in_array($post_type, $book_able)) {
return;
}
$label = get_post_type_object($post_type);
$demo_mode = st()->get_option('edv_enable_demo_mode', 'off');
if (st()->get_option('enable_user_online_noti', 'on') == 'on') {
if ($demo_mode == 'on') {
$data['noty'][] = array('icon' => 'home', 'message' => sprintf(st_get_language('now_s_users_seeing_this_s'), rand(300, 5000), $label->labels->singular_name), 'type' => 'success');
} else {
$data['noty'][] = array('icon' => 'home', 'message' => sprintf(st_get_language('now_s_users_seeing_this_s'), self::get_user_online(get_the_ID()), $label->labels->singular_name), 'type' => 'success');
}
}
if (st()->get_option('enable_last_booking_noti', 'on') == 'on') {
if ($demo_mode == 'on') {
$data['noty'][] = array('icon' => 'clock-o', 'message' => sprintf(st_get_language('most_revent_booking_for_this_s_was_s'), $label->labels->singular_name, sprintf(__('%s minutes ago', ST_TEXTDOMAIN), rand(2, 50))), 'type' => 'warning');
} else {
$data['noty'][] = array('icon' => 'clock-o', 'message' => sprintf(st_get_language('most_revent_booking_for_this_s_was_s'), $label->labels->singular_name, TravelerObject::get_last_booking_string(get_the_ID())), 'type' => 'warning');
}
}
$data['noti_position'] = st()->get_option('noti_position', 'topRight');
}
wp_localize_script('jquery', 'stanalytics', $data);
}
示例9: st_vc_search
function st_vc_search($attr, $content = false)
{
$data = shortcode_atts(array('st_style_search' => 'style_1', 'st_box_shadow' => 'no'), $attr, 'st_search');
extract($data);
$txt = st()->load_template('vc-elements/st-search/search', 'form', array('data' => $data));
return $txt;
}
示例10: is_available
function is_available()
{
if (st()->get_option('pm_gway_st_submit_form_enable') == 'on') {
return true;
}
return false;
}
示例11: st_hotel_room_price_ft
function st_hotel_room_price_ft($args)
{
if (is_singular('hotel_room')) {
return st()->load_template('vc-elements/st-hotel-room/st_hotel_room_price', null, array('attr' => $args));
}
return false;
}
示例12: 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;
}
示例13: __construct
function __construct()
{
$this->dir = st()->dir('plugins/custom-option-tree');
$this->url = st()->url('plugins/custom-option-tree');
add_action('admin_enqueue_scripts', array($this, 'add_scripts'));
add_action('wp_enqueue_scripts', array($this, 'add_scripts'));
}
示例14: content
protected function content($arg, $content = null)
{
$data = shortcode_atts(array('st_avatar' => 0, 'st_name' => 0, 'st_sub' => '', 'st_desc' => '', 'st_bg' => '', 'st_pos' => ''), $arg, 'st_testimonial_item');
extract($data);
$text = st()->load_template('vc-elements/st-slide-testimonial/loop', false, $data);
return $text;
}
示例15: solkit_octal_preprocess_maintenance_page
/**
* Implements template_preprocess_maintenance_page().
*/
function solkit_octal_preprocess_maintenance_page(&$variables)
{
global $install_state;
if ($install_state) {
// Find the number of tasks to run.
$tasks = install_tasks_to_display($install_state);
$total = sizeof($tasks);
// Find the position of the active task.
$keys = array_keys($tasks);
$active_task = $install_state['active_task'];
$current = array_search($active_task, $keys) + 1;
// Show steps.
$variables['steps'] = t('Step @current of @total', array('@current' => $current, '@total' => $total));
$variables['title'] = $tasks[$active_task];
}
$profile = isset($_GET['profile']) ? $_GET['profile'] : '';
if ($profile) {
$path = drupal_get_path('profile', $profile);
$info_file = $path . '/' . $profile . '.info';
$info = drupal_parse_info_file($info_file);
$variables['site_name'] = $info['name'];
$version['version'] = $info['version'];
// Use copyright from distro info file.
if (isset($info['copyright'])) {
$variables['copyright'] = $info['copyright'];
} else {
$variables['copyright'] = st('@name @version', array('@name' => $info['name'], '@version' => $info['version']));
}
// Quick fix to add the required radix-progress.js.
// We assume that Radix is at profiles/*/themes/radix.
// TODO: handle this better.
drupal_add_js($path . '/themes/radix/assets/javascripts/radix-progress.js');
}
}