public static function _class_init() { parent::_class_init(); $file = array('travel-helper', 'class/class.cart', 'admin/class.stadmin', 'st.customvc', 'helpers/st-languages', 'class/class.travelobject', 'class/class.hotel', 'class/class.room', 'class/class.review', 'class/class.order', 'st.customvc', 'class/class.hotel', 'helpers/class.validate'); $file2 = array('class/class.payment_gateways', 'class/class.user', 'class/class.location', 'class/class.cars', 'class/class.tour', 'class/class.holiday', 'class/class.rental', 'class/class.cruise', 'class/class.cabin', 'class/class.activity', 'class/class.coupon', 'class/class.featured', 'class/class.woocommerce', 'helpers/class.date', 'helpers/class.social.login', 'helpers/class.analytics', 'helpers/class.cool-captcha', 'plugins/custom-option-tree/custom-option-tree', 'plugins/custom-option-tree/st-list-item-post-type', 'plugins/custom-option-tree/st-timepicker-field', 'plugins/custom-select-post/custom-select-post', 'helpers/class.iconpicker', 'helpers/st-car-helpers', 'plugins/ot-custom/ot-custom', 'helpers/database.helper', 'helpers/availability.helper', 'helpers/hotel.helper', 'helpers/rental.helper', 'helpers/tour.helper', 'helpers/holiday.helper', 'helpers/activity.helper', 'helpers/car.helper', 'helpers/validate.woo.checkout', 'helpers/validate.normal.checkout', 'helpers/price.helper', 'helpers/partner.booking.helper'); self::load_libs($file); self::load_paypal_libraries(); self::load_libs($file2); self::_load_abstract(); self::_load_modules(); self::$booking_type = apply_filters('st_booking_post_type', array('st_hotel', 'st_activity', 'st_tours', 'st_holidays', 'st_cars', 'st_rental')); if (function_exists('st_reg_post_type') and function_exists('st_reg_taxonomy')) { add_action('init', array(__CLASS__, 'st_attribute_to_taxonomy')); add_action('init', array(__CLASS__, 'st_location_init')); add_action('init', array(__CLASS__, 'st_order_init')); } if (function_exists('st_reg_shortcode')) { /** * Load widget, shortcodes and vc elements. No need use it from plugins * * * @since 1.0.7 * */ self::loadWidgets(); add_action('init', array(__CLASS__, 'loadShortCodes'), 30); if (class_exists('Vc_Manager')) { add_action('init', array(__CLASS__, 'loadVcElements'), 30); } } }
function __construct() { if (self::$_is_inited) { return; } self::$_is_inited = true; $this->plugin_name = 'traveler-code'; parent::__construct(); $file = array('travel-helper', 'admin/class.stadmin', 'st.customvc', 'helpers/st-languages', 'class/class.travelobject', 'class/class.hotel', 'class/class.room', 'class/class.review', 'class/class.order', 'st.customvc', 'class/class.hotel', 'helpers/class.validate', 'class/class.payment_gateways', 'class/class.cart', 'class/class.paypal', 'class/class.user', 'class/class.location', 'class/class.cars', 'class/class.tour', 'class/class.rental', 'class/class.cruise', 'class/class.cabin', 'class/class.activity', 'class/class.coupon', 'class/class.featured', 'class/class.woocommerce', 'helpers/class.date', 'helpers/class.social.login', 'helpers/class.analytics', 'helpers/class.cool-captcha', 'plugins/custom-option-tree/custom-option-tree', 'plugins/custom-select-post/custom-select-post', 'helpers/class.iconpicker', 'helpers/st-car-helpers'); $this->load_libs($file); $this->_load_abstract(); $this->_load_modules(); self::$booking_type = apply_filters('st_booking_post_type', array('st_hotel', 'st_activity', 'st_tours', 'st_cars', 'st_rental')); if (function_exists('st_reg_post_type') and function_exists('st_reg_taxonomy')) { add_action('init', array($this, 'st_attribute_to_taxonomy')); add_action('init', array($this, 'st_location_init')); add_action('init', array($this, 'st_order_init')); } if (function_exists('st_reg_shortcode')) { /** * Load widget, shortcodes and vc elements. No need use it from plugins * * * @since 1.0.7 * */ $this->loadWidgets(); $this->loadShortCodes(); if (class_exists('Vc_Manager')) { add_action('init', array($this, 'loadVcElements'), 20); } } }
function ot_type_product_select_ajax($args = array()) { $booking_types = STTraveler::booking_type(); $default = array('field_placeholder' => __('Search for a Product', ST_TEXTDOMAIN)); $args = wp_parse_args($args, $default); extract($args); $post_type = $field_post_type; /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '<div class="format-setting type-post_select_ajax ' . ($has_desc ? 'has-desc' : 'no-desc') . '">'; /* description */ echo balanceTags($has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : ''); /* format setting inner wrapper */ echo '<div class="format-setting-inner">'; /* allow fields to be filtered */ $post_select_ajax = apply_filters('ot_recognized_post_select_ajax_fields', $field_value, $field_id); $pl_name = ''; $pl_desc = ''; if ($field_value) { $user = get_userdata($field_value); if ($user) { $pl_name = $user->user_login . ' (#' . $user->ID . ' - ' . $user->user_email . ')'; $pl_desc = ""; //"ID: ".get_the_ID($field_value); } } $ids = explode(',', $field_value); $ids_str = array(); if (!empty($ids)) { foreach ($ids as $key) { $ids_str[] = array('id' => $key, 'name' => get_post_type($key) . ' - ' . get_the_title($key), 'description' => get_post_meta($key, 'address', true)); } } echo '<div class="option-tree-ui-user_select_ajax-input-wrap">'; ?> <label ><?php _e('Type:', ST_TEXTDOMAIN); ?> </label> <br> <select class="" name="type"> <?php if (!empty($booking_types)) { ?> <?php foreach ($booking_types as $key => $value) { if (post_type_exists($value)) { $post_type_obj = get_post_type_object($value); echo "<option value='{$value}' >{$post_type_obj->labels->singular_name}</option>"; } } } ?> </select> <br> <label><?php _e('Product: ', ST_TEXTDOMAIN); ?> </label> <?php echo "<input data-old='" . esc_attr(json_encode($ids_str)) . "' data-placeholder='{$field_placeholder}' value='{$field_value}' data-post-type='{$post_type}' type=hidden class='st_product_select_ajax' id='" . esc_attr($field_id) . "' name='" . esc_attr($field_name) . "'/>"; echo '</div>'; echo '</div>'; echo '</div>'; }
static function _get_metabox_booking_types() { $booking_types = STTraveler::booking_type(); $r = array(); if (!empty($booking_types)) { foreach ($booking_types as $key => $value) { if (post_type_exists($value)) { $post_type_obj = get_post_type_object($value); $r[] = array('label' => $post_type_obj->labels->singular_name, 'value' => $value); } } } return $r; }