function init() { if (!st_check_service_available('st_hotel')) { return; } parent::init(); //add_filter('st_data_custom_price',array($this,'_st_data_custom_price')); }
function init() { if (!st_check_service_available('st_hotel')) { return; } parent::init(); //$this->init_metabox(); add_action('posts_where', array($this, '_alter_search_query')); add_filter('st_data_custom_price', array($this, '_st_data_custom_price')); }
function __construct() { if (!st_check_service_available('st_rental')) { return; } parent::__construct(); //add colum for rooms add_filter('manage_rental_room_posts_columns', array($this, 'add_col_header'), 10); add_action('manage_rental_room_posts_custom_column', array($this, 'add_col_content'), 10, 2); add_action('init', array($this, 'init_metabox')); add_filter('st_rental_room_layout', array($this, 'custom_rental_room_layout')); }
/** * * * * */ function init_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } // Activity ============================================================== $labels = array('name' => __('Activity', ST_TEXTDOMAIN), 'singular_name' => __('Activity', ST_TEXTDOMAIN), 'menu_name' => __('Activity', ST_TEXTDOMAIN), 'name_admin_bar' => __('Activity', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Activity', ST_TEXTDOMAIN), 'new_item' => __('New Activity', ST_TEXTDOMAIN), 'edit_item' => __('Edit Activity', ST_TEXTDOMAIN), 'view_item' => __('View Activity', ST_TEXTDOMAIN), 'all_items' => __('All Activity', ST_TEXTDOMAIN), 'search_items' => __('Search Activity', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Activity:', ST_TEXTDOMAIN), 'not_found' => __('No Activity found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No Activity found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('activity_permalink', 'st_activity')), 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('author', 'title', 'editor', 'excerpt', 'thumbnail', 'comments'), 'menu_icon' => 'dashicons-tickets-alt-st'); st_reg_post_type('st_activity', $args); }
/** * Init the post type * * @since 1.1.3 * */ function _init_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } // Tours ============================================================== $labels = array('name' => __('Tours', ST_TEXTDOMAIN), 'singular_name' => __('Tour', ST_TEXTDOMAIN), 'menu_name' => __('Tours', ST_TEXTDOMAIN), 'name_admin_bar' => __('Tour', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Tour', ST_TEXTDOMAIN), 'new_item' => __('New Tour', ST_TEXTDOMAIN), 'edit_item' => __('Edit Tour', ST_TEXTDOMAIN), 'view_item' => __('View Tour', ST_TEXTDOMAIN), 'all_items' => __('All Tour', ST_TEXTDOMAIN), 'search_items' => __('Search Tour', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Tour:', ST_TEXTDOMAIN), 'not_found' => __('No Tours found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No Tours found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('tour_permalink', 'st_tour')), 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('author', 'title', 'editor', 'excerpt', 'thumbnail', 'comments'), 'menu_icon' => 'dashicons-palmtree-st'); st_reg_post_type('st_tours', $args); $labels = array('name' => __('Tours Type', 'taxonomy general name', ST_TEXTDOMAIN), 'singular_name' => __('Tours Type', 'taxonomy singular name', ST_TEXTDOMAIN), 'search_items' => __('Search Tours Type', ST_TEXTDOMAIN), 'popular_items' => __('Popular Tours Type', ST_TEXTDOMAIN), 'all_items' => __('All Tours Type', ST_TEXTDOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Tour Type', ST_TEXTDOMAIN), 'update_item' => __('Update Tour Type', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Pickup Feature', ST_TEXTDOMAIN), 'new_item_name' => __('New Tour Type Name', ST_TEXTDOMAIN), 'separate_items_with_commas' => __('Separate Tour Type with commas', ST_TEXTDOMAIN), 'add_or_remove_items' => __('Add or remove Tour Type', ST_TEXTDOMAIN), 'choose_from_most_used' => __('Choose from the most used Tour Type', ST_TEXTDOMAIN), 'not_found' => __('No Pickup Tour Type.', ST_TEXTDOMAIN), 'menu_name' => __('Tours Type', ST_TEXTDOMAIN)); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'st_tour_type')); st_reg_taxonomy('st_tour_type', 'st_tours', $args); }
/** * * * @update 1.1.3 * */ function __construct() { if (!st_check_service_available('st_hotel')) { return; } add_filter('st_hotel_room_layout', array($this, 'custom_hotel_room_layout')); add_action('init', array($this, 'init_metabox')); //alter where for search room add_filter('posts_where', array(__CLASS__, '_alter_search_query')); //Hotel Hook /* * todo Re-cal hotel min price * */ add_action('update_post_meta', array($this, 'hotel_update_min_price'), 10, 4); add_action('updated_post_meta', array($this, 'meta_updated_update_min_price'), 10, 4); add_action('added_post_meta', array($this, 'hotel_update_min_price'), 10, 4); add_action('save_post', array($this, '_update_avg_price'), 50); parent::__construct(); }
/** * Init the post type * * */ function init_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } $labels = array('name' => __('Hotels', ST_TEXTDOMAIN), 'singular_name' => __('Hotel Name', ST_TEXTDOMAIN), 'menu_name' => __('Hotels', ST_TEXTDOMAIN), 'name_admin_bar' => __('Hotel Name', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Hotel', ST_TEXTDOMAIN), 'new_item' => __('New Hotel', ST_TEXTDOMAIN), 'edit_item' => __('Edit Hotel', ST_TEXTDOMAIN), 'view_item' => __('View Hotel', ST_TEXTDOMAIN), 'all_items' => __('All Hotels', ST_TEXTDOMAIN), 'search_items' => __('Search Hotels', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Hotels:', ST_TEXTDOMAIN), 'not_found' => __('No hotels found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No hotels found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'menu_icon' => 'dashicons-building-yl', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('hotel_permalink', 'st_hotel')), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments')); st_reg_post_type('st_hotel', $args); $labels = array('name' => __('Room(s)', ST_TEXTDOMAIN), 'singular_name' => __('Room', ST_TEXTDOMAIN), 'menu_name' => __('Room(s)', ST_TEXTDOMAIN), 'name_admin_bar' => __('Room', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Room', ST_TEXTDOMAIN), 'new_item' => __('New Room', ST_TEXTDOMAIN), 'edit_item' => __('Edit Room', ST_TEXTDOMAIN), 'view_item' => __('View Room', ST_TEXTDOMAIN), 'all_items' => __('All Rooms', ST_TEXTDOMAIN), 'search_items' => __('Search Rooms', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Rooms:', ST_TEXTDOMAIN), 'not_found' => __('No rooms found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No rooms found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'), 'menu_icon' => 'dashicons-building-yl', 'exclude_from_search' => true); st_reg_post_type('hotel_room', $args); $name = __('Room Type', ST_TEXTDOMAIN); $labels = array('name' => $name, 'singular_name' => $name, 'search_items' => sprintf(__('Search %s', ST_TEXTDOMAIN), $name), 'all_items' => sprintf(__('All %s', ST_TEXTDOMAIN), $name), 'parent_item' => sprintf(__('Parent %s', ST_TEXTDOMAIN), $name), 'parent_item_colon' => sprintf(__('Parent %s', ST_TEXTDOMAIN), $name), 'edit_item' => sprintf(__('Edit %s', ST_TEXTDOMAIN), $name), 'update_item' => sprintf(__('Update %s', ST_TEXTDOMAIN), $name), 'add_new_item' => sprintf(__('New %s', ST_TEXTDOMAIN), $name), 'new_item_name' => sprintf(__('New %s', ST_TEXTDOMAIN), $name), 'menu_name' => $name); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_ui' => 'edit.php?post_type=st_hotel', 'query_var' => true); st_reg_taxonomy('room_type', 'hotel_room', $args); }
/** * Init the post type * * @since 1.1.3 * */ function _init_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } // Tours ============================================================== $labels = array('name' => __('Food', ST_TEXTDOMAIN), 'singular_name' => __('Food', ST_TEXTDOMAIN), 'menu_name' => __('Food', ST_TEXTDOMAIN), 'name_admin_bar' => __('Food', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Food', ST_TEXTDOMAIN), 'new_item' => __('New Food', ST_TEXTDOMAIN), 'edit_item' => __('Edit Food', ST_TEXTDOMAIN), 'view_item' => __('View Food', ST_TEXTDOMAIN), 'all_items' => __('All Food', ST_TEXTDOMAIN), 'search_items' => __('Search Food', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Food:', ST_TEXTDOMAIN), 'not_found' => __('No Food found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No Food found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('food_permalink', 'st_food')), 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('author', 'title', 'editor', 'excerpt', 'thumbnail', 'comments'), 'menu_icon' => 'dashicons-carrot'); st_reg_post_type('st_food', $args); $labels = array('name' => __('Cuisine Type', 'taxonomy general name', ST_TEXTDOMAIN), 'singular_name' => __('Cuisine Type', 'taxonomy singular name', ST_TEXTDOMAIN), 'search_items' => __('Search Cuisine Type', ST_TEXTDOMAIN), 'popular_items' => __('Popular Cuisine Type', ST_TEXTDOMAIN), 'all_items' => __('All Cuisine Type', ST_TEXTDOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Cuisine Type', ST_TEXTDOMAIN), 'update_item' => __('Update Cuisine Type', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Cuisine Feature', ST_TEXTDOMAIN), 'new_item_name' => __('New Cuisine Type Name', ST_TEXTDOMAIN), 'separate_items_with_commas' => __('Separate Cuisine Type with commas', ST_TEXTDOMAIN), 'add_or_remove_items' => __('Add or remove Cuisine Type', ST_TEXTDOMAIN), 'choose_from_most_used' => __('Choose from the most used Cuisine Type', ST_TEXTDOMAIN), 'not_found' => __('No Cuisine Type.', ST_TEXTDOMAIN), 'menu_name' => __('Cuisine Type', ST_TEXTDOMAIN)); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'st_cuisine_type')); st_reg_taxonomy('st_cuisine_type', 'st_food', $args); $labels = array('name' => __('Restaurent', 'taxonomy general name', ST_TEXTDOMAIN), 'singular_name' => __('Restaurent', 'taxonomy singular name', ST_TEXTDOMAIN), 'search_items' => __('Search Restaurent', ST_TEXTDOMAIN), 'popular_items' => __('Popular Restaurent', ST_TEXTDOMAIN), 'all_items' => __('All Restaurent', ST_TEXTDOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Restaurent', ST_TEXTDOMAIN), 'update_item' => __('Update Restaurent', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Restaurent Feature', ST_TEXTDOMAIN), 'new_item_name' => __('New Restaurent Name', ST_TEXTDOMAIN), 'separate_items_with_commas' => __('Separate Restaurent with commas', ST_TEXTDOMAIN), 'add_or_remove_items' => __('Add or remove Restaurent', ST_TEXTDOMAIN), 'choose_from_most_used' => __('Choose from the most used Restaurent', ST_TEXTDOMAIN), 'not_found' => __('No Restaurent.', ST_TEXTDOMAIN), 'menu_name' => __('Restaurent', ST_TEXTDOMAIN)); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'st_restaurent_type')); st_reg_taxonomy('st_restaurent_type', 'st_food', $args); }
/** * * * @since 1.1.3 * */ function _init_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } // Cars ============================================================== $labels = array('name' => __('Cars', ST_TEXTDOMAIN), 'singular_name' => __('Car', ST_TEXTDOMAIN), 'menu_name' => __('Cars', ST_TEXTDOMAIN), 'name_admin_bar' => __('Car', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Car', ST_TEXTDOMAIN), 'new_item' => __('New Car', ST_TEXTDOMAIN), 'edit_item' => __('Edit Car', ST_TEXTDOMAIN), 'view_item' => __('View Car', ST_TEXTDOMAIN), 'all_items' => __('All Cars', ST_TEXTDOMAIN), 'search_items' => __('Search Cars', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Cars:', ST_TEXTDOMAIN), 'not_found' => __('No Cars found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No Cars found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('car_permalink', 'st_car')), 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'supports' => array('author', 'title', 'editor', 'excerpt', 'thumbnail', 'comments'), 'menu_icon' => 'dashicons-dashboard-st'); st_reg_post_type('st_cars', $args); // category cars $labels = array('name' => __('Car Category', 'taxonomy general name', ST_TEXTDOMAIN), 'singular_name' => __('Car Category', 'taxonomy singular name', ST_TEXTDOMAIN), 'search_items' => __('Search Car Category', ST_TEXTDOMAIN), 'popular_items' => __('Popular Car Category', ST_TEXTDOMAIN), 'all_items' => __('All Car Category', ST_TEXTDOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Car Category', ST_TEXTDOMAIN), 'update_item' => __('Update Car Category', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Car Category', ST_TEXTDOMAIN), 'new_item_name' => __('New Pickup Car Category', ST_TEXTDOMAIN), 'separate_items_with_commas' => __('Separate Car Category with commas', ST_TEXTDOMAIN), 'add_or_remove_items' => __('Add or remove Car Category', ST_TEXTDOMAIN), 'choose_from_most_used' => __('Choose from the most used Car Category', ST_TEXTDOMAIN), 'not_found' => __('No Car Category found.', ST_TEXTDOMAIN), 'menu_name' => __('Car Category', ST_TEXTDOMAIN)); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'st_category_cars')); st_reg_taxonomy('st_category_cars', 'st_cars', $args); $labels = array('name' => st_get_language('car_pickup_features'), 'singular_name' => st_get_language('car_pickup_features'), 'search_items' => st_get_language('car_search_pickup_features'), 'popular_items' => __('Popular Pickup Features', ST_TEXTDOMAIN), 'all_items' => __('All Pickup Features', ST_TEXTDOMAIN), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __('Edit Pickup Feature', ST_TEXTDOMAIN), 'update_item' => __('Update Pickup Feature', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Pickup Feature', ST_TEXTDOMAIN), 'new_item_name' => __('New Pickup Feature Name', ST_TEXTDOMAIN), 'separate_items_with_commas' => __('Separate Pickup Features with commas', ST_TEXTDOMAIN), 'add_or_remove_items' => __('Add or remove Pickup Features', ST_TEXTDOMAIN), 'choose_from_most_used' => __('Choose from the most used Pickup Features', ST_TEXTDOMAIN), 'not_found' => __('No Pickup Features found.', ST_TEXTDOMAIN), 'menu_name' => __('Pickup Features', ST_TEXTDOMAIN)); $args = array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array('slug' => 'st_cars_pickup_features')); st_reg_taxonomy('st_cars_pickup_features', 'st_cars', $args); }
/** * * * @since 1.1.3 * */ function _reg_post_type() { if (!st_check_service_available($this->post_type)) { return; } if (!function_exists('st_reg_post_type')) { return; } // Rental ============================================================== $labels = array('name' => __('Rental', ST_TEXTDOMAIN), 'singular_name' => __('Rental', ST_TEXTDOMAIN), 'menu_name' => __('Rental', ST_TEXTDOMAIN), 'name_admin_bar' => __('Rental', ST_TEXTDOMAIN), 'add_new' => __('Add Rental', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Rental', ST_TEXTDOMAIN), 'new_item' => __('New Rental', ST_TEXTDOMAIN), 'edit_item' => __('Edit Rental', ST_TEXTDOMAIN), 'view_item' => __('View Rental', ST_TEXTDOMAIN), 'all_items' => __('All Rental', ST_TEXTDOMAIN), 'search_items' => __('Search Rental', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Rental:', ST_TEXTDOMAIN), 'not_found' => __('No Rental found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No Rental found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => get_option('rental_permalink', 'st_rental')), 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'), 'menu_icon' => 'dashicons-admin-home-st'); st_reg_post_type('st_rental', $args); // post type rental /** *@since 1.1.3 * Rental room **/ $labels = array('name' => __('Room(s)', ST_TEXTDOMAIN), 'singular_name' => __('Room', ST_TEXTDOMAIN), 'menu_name' => __('Room(s)', ST_TEXTDOMAIN), 'name_admin_bar' => __('Room', ST_TEXTDOMAIN), 'add_new' => __('Add New', ST_TEXTDOMAIN), 'add_new_item' => __('Add New Room', ST_TEXTDOMAIN), 'new_item' => __('New Room', ST_TEXTDOMAIN), 'edit_item' => __('Edit Room', ST_TEXTDOMAIN), 'view_item' => __('View Room', ST_TEXTDOMAIN), 'all_items' => __('All Rooms', ST_TEXTDOMAIN), 'search_items' => __('Search Rooms', ST_TEXTDOMAIN), 'parent_item_colon' => __('Parent Rooms:', ST_TEXTDOMAIN), 'not_found' => __('No rooms found.', ST_TEXTDOMAIN), 'not_found_in_trash' => __('No rooms found in Trash.', ST_TEXTDOMAIN)); $args = array('labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'), 'menu_icon' => 'dashicons-admin-home-st', 'exclude_from_search' => true, 'show_in_menu' => 'edit.php?post_type=st_rental'); st_reg_post_type('rental_room', $args); }
<div class="panel-footer"> <span class="pull-left"><?php _e("View Details", ST_TEXTDOMAIN); ?> </span> <span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span> <div class="clearfix"></div> </div> </a> </div> </div> <?php } ?> <?php if (st_check_service_available('st_activity')) { ?> <div class="col-md-4"> <div class="panel panel-primary panel-st_activity panel-single"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa <?php echo apply_filters('st_post_type_st_activity_icon', ''); ?> fa-5x"></i> </div> <div class="col-xs-9 text-right"> <div class="huge"> <?php $price = $this_data_custom['post_type']['st_activity']['average_total'];
function st_vc_all_post_type_content_search($attr, $content = false) { $default = array('st_style' => 1, 'st_number' => 5); $attr = wp_parse_args($attr, $default); extract($attr); if (!is_page_template('template-search-all-post-type.php')) { return ""; } $html = ''; global $wp_query, $st_search_query; $data_post_type = STInput::request('data_post_type', 'all'); if ($data_post_type == 'all') { $data_post_type = array('st_hotel', 'st_rental', 'st_cars', 'st_tours', 'st_holidays', 'st_activity'); } else { $data_post_type = array($data_post_type); } /////////////////////////////// ////// Hotel ////////////////////////////// if (st_check_service_available('st_hotel') and in_array('st_hotel', $data_post_type)) { $hotel = new STHotel(); add_action('pre_get_posts', array($hotel, 'change_search_hotel_arg')); query_posts(array('post_type' => 'st_hotel', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; remove_action('pre_get_posts', array($hotel, 'change_search_hotel_arg')); $hotel->remove_alter_search_query(); wp_reset_query(); } /////////////////////////////// ////// Rental ////////////////////////////// if (st_check_service_available('st_rental') and in_array('st_rental', $data_post_type)) { $rental = new STRental(); add_action('pre_get_posts', array($rental, 'change_search_arg')); query_posts(array('post_type' => 'st_rental', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; remove_action('pre_get_posts', array($rental, 'change_search_arg')); $rental->remove_alter_search_query(); wp_reset_query(); } /////////////////////////////// ////// Activity ////////////////////////////// if (st_check_service_available('st_activity') and in_array('st_activity', $data_post_type)) { $activity = new STActivity(); add_action('pre_get_posts', array($activity, 'change_search_activity_arg')); query_posts(array('post_type' => 'st_activity', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; remove_action('pre_get_posts', array($activity, 'change_search_activity_arg')); $activity->remove_alter_search_query(); wp_reset_query(); } /////////////////////////////// ////// Cars ////////////////////////////// if (st_check_service_available('st_cars') and in_array('st_cars', $data_post_type)) { $cars = new STCars(); add_action('pre_get_posts', array($cars, 'change_search_cars_arg')); query_posts(array('post_type' => 'st_cars', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; remove_action('pre_get_posts', array($cars, 'change_search_cars_arg')); $cars->remove_alter_search_query(); wp_reset_query(); } /////////////////////////////// ////// Tours ////////////////////////////// if (st_check_service_available('st_tours') and in_array('st_tours', $data_post_type)) { $tours = new STTour(); $tours->alter_search_query(); add_action('pre_get_posts', array($tours, 'change_search_tour_arg')); query_posts(array('post_type' => 'st_tours', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; $tours->remove_alter_search_query(); wp_reset_query(); } /////////////////////////////// ////// Holidays ////////////////////////////// if (st_check_service_available('st_holidays') and in_array('st_holidays', $data_post_type)) { $holidays = new STHoliday(); $holidays->alter_search_query(); add_action('pre_get_posts', array($holidays, 'change_search_holiday_arg')); query_posts(array('post_type' => 'st_holidays', 's' => '', 'paged' => get_query_var('paged'), 'posts_per_page' => $st_number)); $st_search_query = $wp_query; $html .= st()->load_template('search/search-all-post-type/content', 'all-post-type', array('attr' => $attr)); $html .= '<br>'; $holidays->remove_alter_search_query(); wp_reset_query(); } return $html; }
/** * * @since 1.1.3 * */ function is_available() { return st_check_service_available('st_activity'); }
<?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'); }
/** * * * @update 1.1.3 * */ static function st_attribute_to_taxonomy() { $attributes = $attr = get_option('st_attribute_taxonomy'); if (!empty($attributes) and is_array($attributes)) { foreach ($attributes as $key => $value) { $name = $value['name']; $slug = $key; $hierarchical = $value['hierarchical']; $post_type = $value['post_type']; // Add new taxonomy, make it hierarchical (like categories) if (st_check_service_available($post_type)) { $labels = array('name' => $name, 'singular_name' => $name, 'search_items' => sprintf(__('Search %s', ST_TEXTDOMAIN), $name), 'all_items' => sprintf(__('All %s', ST_TEXTDOMAIN), $name), 'parent_item' => sprintf(__('Parent %s', ST_TEXTDOMAIN), $name), 'parent_item_colon' => sprintf(__('Parent %s', ST_TEXTDOMAIN), $name), 'edit_item' => sprintf(__('Edit %s', ST_TEXTDOMAIN), $name), 'update_item' => sprintf(__('Update %s', ST_TEXTDOMAIN), $name), 'add_new_item' => sprintf(__('New %s', ST_TEXTDOMAIN), $name), 'new_item_name' => sprintf(__('New %s', ST_TEXTDOMAIN), $name), 'menu_name' => $name); $args = array('hierarchical' => $hierarchical, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true); st_reg_taxonomy($slug, $post_type, $args); } } } }
<?php if (!st_check_service_available('st_rental')) { return; } if (function_exists('vc_map')) { vc_map(array("name" => __("ST Rental Photo", ST_TEXTDOMAIN), "base" => "st_rental_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_rental_photo')) { function st_vc_rental_photo($attr, $content = false) { $default = array('style' => 'slide'); $attr = wp_parse_args($attr, $default); if (is_singular('st_rental')) { return st()->load_template('rental/elements/photo', null, array('attr' => $attr)); } } } if (st_check_service_available('st_rental')) { st_reg_shortcode('st_rental_photo', 'st_vc_rental_photo'); }
function st_search_tour_widget_register() { if (st_check_service_available('st_tours')) { register_widget('st_widget_search_tour'); } }
<?php /** * ST Thumbnail Cars * @since 1.1.0 **/ if (!st_check_service_available('st_cars')) { return; } if (function_exists('vc_map')) { vc_map(array('name' => __("ST Car Thumbnail", ST_TEXTDOMAIN), 'base' => 'st_thumbnail_cars', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Car', 'show_settings_on_create' => false, 'params' => array())); } if (!function_exists('st_thumbnail_cars_func')) { function st_thumbnail_cars_func() { if (is_singular('st_cars')) { return st()->load_template('cars/elements/image', 'featured'); } } st_reg_shortcode('st_thumbnail_cars', 'st_thumbnail_cars_func'); } /** * ST Excerpt Cars * @since 1.1.0 **/ if (function_exists('vc_map')) { vc_map(array('name' => __("ST Car Excerpt", ST_TEXTDOMAIN), 'base' => 'st_excerpt_cars', 'content_element' => true, 'icon' => 'icon-st', 'category' => 'Car', 'show_settings_on_create' => false, 'params' => array())); } if (!function_exists('st_excerpt_cars_func')) { function st_excerpt_cars_func() {
echo esc_url(add_query_arg('sc', 'booking-cars', $user_link)); ?> "> <i class="fa fa-cab"> </i><?php _e("Car Bookings", ST_TEXTDOMAIN); ?> </a> </li> </ul> </li> <?php } ?> <?php if ($v['id_partner'] == 'rental' && st_check_service_available('st_rental')) { ?> <li class="item <?php if (in_array($sc, array('create-rental', 'my-rental', 'create-room-rental', 'my-room-rental', 'booking-rental'))) { echo "active"; } ?> "> <a class="cursor" style="cursor: pointer !important"> <i class="fa fa-home"></i></i> <?php _e('Rental', ST_TEXTDOMAIN); ?> <span class="arrow"></span> </a> <ul class="sub-menu item">
function st_search_rental_widget_register() { if (st_check_service_available('st_rental')) { register_widget('st_widget_search_rental'); } }
/** * @since 1.1.9 **/ static function get_opt_list_std() { $array = array(array('title' => __("Map", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-map-marker", 'tab_type' => "st_map", 'map_height' => "500", 'map_spots' => "500", 'map_location_style' => "normal")); if (st_check_service_available('st_cars')) { $array[] = array('title' => __("Car", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-car", 'tab_type' => "st_cars"); } if (st_check_service_available('st_hotel')) { $array[] = array('title' => __("Hotel", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-building-o", 'tab_type' => "st_hotel"); } if (st_check_service_available('st_tours')) { $array[] = array('title' => __("Tour", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-flag-o", 'tab_type' => "st_tours"); } if (st_check_service_available('st_holidays')) { $array[] = array('title' => __("Holiday", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-flag-o", 'tab_type' => "st_holidays"); } if (st_check_service_available('st_activity')) { $array[] = array('title' => __("Activity", ST_TEXTDOMAIN), 'tab_icon_' => "fa fa-bolt", 'tab_type' => "st_activity"); } if (st_check_service_available('st_rental')) { $array[] = array('title' => __("Rental", ST_TEXTDOMAIN), 'tab_icon_' => "fa-home", 'tab_type' => "st_rental"); } return $array; }
static function get_location() { if (is_search() || is_page()) { return; } $post_type = get_post_type(get_the_ID()); $array = array('st_hotel', 'st_activity', 'st_rental', 'st_tours', 'st_holidays'); if (!in_array($post_type, $array)) { return; } if (!st_check_service_available($post_type)) { return; } $location = get_post_meta(get_the_ID(), 'multi_location', true); if (!empty($location)) { $location = explode(',', $location); $location = $location[0]; $location = explode("_", $location); $location = $location[1]; } if (!$location) { $location = get_post_meta(get_the_ID(), 'location_id', true); } if (!$location) { $location = get_post_meta(get_the_ID(), 'id_location', true); } if (!$location) { return; } return $location; }
$terms[] = $value; } } if ($terms) { $query['tax_query'] = array(array('taxonomy' => $sort_taxonomy, 'field' => 'id', 'terms' => $terms)); } } } query_posts($query); if ($st_style == 'style_1') { $r = "<div class='list_tours'>" . st()->load_template('vc-elements/st-list-tour/loop', '', $data) . "</div>"; } if ($st_style == 'style_2') { $r = "<div class='list_tours'>" . st()->load_template('vc-elements/st-list-tour/loop2', '', $data) . "</div>"; } if ($st_style == 'style_3') { $r = "<div class='list_tours'>" . st()->load_template('vc-elements/st-list-tour/loop3', '', $data) . "</div>"; } if ($st_style == 'style_4') { $r = "<div class='list_tours'>" . st()->load_template('vc-elements/st-list-tour/loop4', '', $data) . "</div>"; } wp_reset_query(); if (!empty($title) and !empty($r)) { $r = '<h' . $font_size . '>' . $title . '</h' . $font_size . '>' . $r; } return $r; } } if (st_check_service_available('st_tours')) { st_reg_shortcode('st_list_tour_related', 'st_list_tour_related'); }
function is_available() { return st_check_service_available($this->post_type); }
function st_search_holiday_widget_register() { if (st_check_service_available('st_holidays')) { register_widget('st_widget_search_holiday'); } }
<?php if (!st_check_service_available('st_hotel')) { return; } if (function_exists('vc_map')) { vc_map(array("name" => __("ST Hotel List Room", ST_TEXTDOMAIN), "base" => "st_hotel_list_room", "content_element" => true, "category" => "Shinetheme", "icon" => "icon-st", "params" => array(array("type" => "dropdown", "heading" => __("Rows", ST_TEXTDOMAIN), "param_name" => "st_rows", "value" => array(__("--Select--", ST_TEXTDOMAIN) => "", __("1", ST_TEXTDOMAIN) => "1", __("2", ST_TEXTDOMAIN) => "2", __("3", ST_TEXTDOMAIN) => "3", __("4", ST_TEXTDOMAIN) => "4", __("5", ST_TEXTDOMAIN) => "5", __("6", ST_TEXTDOMAIN) => "6")), array("type" => "dropdown", "heading" => __("Items in a row", ST_TEXTDOMAIN), "param_name" => "st_items_in_row", "value" => array(__("--Select--", ST_TEXTDOMAIN) => "", __("1", ST_TEXTDOMAIN) => "1", __("2", ST_TEXTDOMAIN) => "2", __("3", ST_TEXTDOMAIN) => "3", __("4", ST_TEXTDOMAIN) => "4", __("6", ST_TEXTDOMAIN) => "6")), array("type" => "dropdown", "heading" => __("Show Title", ST_TEXTDOMAIN), "param_name" => "is_title", "description" => "", "value" => array(__("--Select--", ST_TEXTDOMAIN) => "", __("Yes", ST_TEXTDOMAIN) => "yes", __("No", ST_TEXTDOMAIN) => "no")), array("type" => "dropdown", "heading" => __("Show Price", ST_TEXTDOMAIN), "param_name" => "is_price", "description" => "", "value" => array(__("--Select--", ST_TEXTDOMAIN) => "", __("Yes", ST_TEXTDOMAIN) => "yes", __("No", ST_TEXTDOMAIN) => "no")), array("type" => "dropdown", "heading" => __("Show Facilities", ST_TEXTDOMAIN), "param_name" => "is_facilities", "description" => "", "value" => array(__("--Select--", ST_TEXTDOMAIN) => "", __("Yes", ST_TEXTDOMAIN) => "yes", __("No", ST_TEXTDOMAIN) => "no"))))); if (!function_exists('st_hotel_list_room_func')) { function st_hotel_list_room_func($attr) { $data = shortcode_atts(array('st_rows' => 2, 'st_items_in_row' => 3, 'is_title' => 'yes', 'is_facilities' => 'yes', 'is_price' => 'yes'), $attr, 'st_hotel_list_room'); extract($data); $arg = array('post_type' => 'hotel_room', 'posts_per_page' => $st_items_in_row * $st_rows, 'post_status' => 'publish'); query_posts($arg); $return = ""; $return .= "<div class='st_hotel_list_room st_grid'>"; if (have_posts()) { while (have_posts()) { the_post(); $return .= st()->load_template('vc-elements/st-hotel-list-room/st_hotel_list_room', null, $data); } } wp_reset_postdata(); $return .= "</div>"; return $return; } if (st_check_service_available('st_hotel')) { st_reg_shortcode('st_hotel_list_room', 'st_hotel_list_room_func'); } } }
function st_search_activity_widget_register() { if (st_check_service_available('st_activity')) { register_widget('st_widget_search_activity'); } }