Exemplo n.º 1
0
        {
            $this->metabox[] = array('id' => 'st_cruise', 'title' => __('Cruise Detail', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array($this->post_type), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Cruise Information', ST_TEXTDOMAIN), 'id' => 'cruise_tab', 'type' => 'tab'), array('id' => 'layout_id', 'label' => __('Custom Layout', ST_TEXTDOMAIN), 'type' => 'custom-post-type-select', 'desc' => __("Set as Featured Cruise", ST_TEXTDOMAIN), 'post_type' => 'st_layouts'), array('id' => 'is_feature', 'label' => __('Set as Featured', ST_TEXTDOMAIN), 'type' => 'on-off', 'desc' => __("Set as Featured Cruise", ST_TEXTDOMAIN), 'std' => 'off'), array('id' => 'st_children_free', 'label' => __('Number of children stay free', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,14,1', 'desc' => __('Number of children stay free', ST_TEXTDOMAIN)), array('id' => 'st_is_price_per_persion', 'label' => __('Price per person?', ST_TEXTDOMAIN), 'type' => 'on-off', 'desc' => __('Price per person?', ST_TEXTDOMAIN)), array('id' => 'gallery', 'label' => __('Gallery', ST_TEXTDOMAIN), 'type' => 'gallery', 'desc' => __('Gallery', ST_TEXTDOMAIN)), array('id' => 'video', 'label' => __('Video', ST_TEXTDOMAIN), 'type' => 'text', 'desc' => __('Video', ST_TEXTDOMAIN)), array('id' => 'programes', 'label' => __('Programes', ST_TEXTDOMAIN), 'type' => 'list-item', 'settings' => array(array('id' => 'desc', 'label' => __('Description', ST_TEXTDOMAIN), 'type' => 'textarea'))), array('label' => __('Location Information', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('id' => 'location_id', 'label' => __('Location', ST_TEXTDOMAIN), 'type' => 'post-select-ajax', 'post_type' => 'location', 'desc' => __('Type location name to search', ST_TEXTDOMAIN)), array('id' => 'address', 'label' => __('Address', ST_TEXTDOMAIN), 'type' => 'text', 'desc' => __('Cruise\'s address ', ST_TEXTDOMAIN)), array('label' => __('Latitude', ST_TEXTDOMAIN), 'id' => 'map_lat', 'type' => 'text', 'desc' => __('Latitude <a href="http://www.latlong.net/" target="_blank">Get here</a>', ST_TEXTDOMAIN)), array('label' => __('Longitude', ST_TEXTDOMAIN), 'id' => 'map_lng', 'type' => 'text', 'desc' => __('Longitude', ST_TEXTDOMAIN)), array('label' => __('Map Zoom', ST_TEXTDOMAIN), 'id' => 'map_zoom', 'type' => 'text', 'desc' => __('Map Zoom', ST_TEXTDOMAIN), 'std' => 13), array('label' => __('Contact Infomaiton', ST_TEXTDOMAIN), 'id' => 'contact_tab', 'type' => 'tab'), array('label' => __('Cruise Email', ST_TEXTDOMAIN), 'id' => 'email', 'type' => 'text', 'desc' => __('Cruise Email Address', ST_TEXTDOMAIN)), array('label' => __('Cruise Website', ST_TEXTDOMAIN), 'id' => 'website', 'type' => 'text', 'desc' => __('Cruise Website. Ex: <em>http://domain.com</em>', ST_TEXTDOMAIN)), array('label' => __('Cruise Phone', ST_TEXTDOMAIN), 'id' => 'phone', 'type' => 'text', 'desc' => __('Cruise Phone Number', ST_TEXTDOMAIN)), array('label' => __('Cruise Fax Number', ST_TEXTDOMAIN), 'id' => 'fax', 'type' => 'text', 'desc' => __('Cruise Fax Number', ST_TEXTDOMAIN))));
        }
        static function search_room($param = array())
        {
            $default = array('cruise_id' => false, 'adult_num' => false, 'child_num' => false, 'cabin_type' => 0);
            $page = STInput::request('paged');
            if (!$page) {
                $page = get_query_var('paged');
            }
            extract(wp_parse_args($param, $default));
            $arg = array('post_type' => 'cruise_cabin', 'posts_per_page' => '15', 'paged' => $page);
            if ($adult_num) {
                $arg['meta_query'][] = array('key' => 'adult_number', 'compare' => '=', 'value' => $adult_num);
            }
            if ($child_num === 0 or $child_num) {
                $arg['meta_query'][] = array('key' => 'children_number', 'compare' => '=', 'value' => $child_num);
            }
            if ($cabin_id) {
                $arg['meta_key'] = 'cruise_id';
                $arg['meta_value'] = $room_parent;
            }
            if ($cabin_type) {
                $arg['tax_query'][] = array('taxonomy' => 'cabin_type', 'terms' => $cabin_type);
            }
            return $arg;
        }
    }
    $a = new STCruise();
    $a->init();
}
Exemplo n.º 2
0
 function st_search_cruise_title($arg = array())
 {
     if (!get_post_type() == 'cruise') {
         return;
     }
     $default = array('search_modal' => 1);
     extract(wp_parse_args($arg, $default));
     $object = new STCruise();
     $a = '<h3 class="booking-title">' . balanceTags($object->get_result_string());
     if ($search_modal) {
         $a .= '<small><a class="popup-text" href="#search-dialog" data-effect="mfp-zoom-out">' . __('Change search') . '</a></small>';
     }
     $a .= '</h3>';
     return $a;
 }