本文整理汇总了PHP中TravelHelper::is_https方法的典型用法代码示例。如果您正苦于以下问题:PHP TravelHelper::is_https方法的具体用法?PHP TravelHelper::is_https怎么用?PHP TravelHelper::is_https使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TravelHelper
的用法示例。
在下文中一共展示了TravelHelper::is_https方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_scripts
function add_scripts()
{
if (TravelHelper::is_https()) {
wp_register_script('gmap-api', 'https://maps.google.com/maps/api/js?sensor=false&language=en&libraries=places', null, false, true);
} else {
wp_register_script('gmap-api', 'http://maps.google.com/maps/api/js?sensor=false&language=en&libraries=places', null, false, true);
}
wp_register_script('gmapv3', $this->_url . 'js/gmap3.min.js', array('jquery', 'gmap-api'), false, true);
wp_register_script('bt-gmapv3-init', $this->_url . 'js/init.js', array('gmapv3'), false, true);
wp_register_style('bt-gmapv3', $this->_url . 'css/bt-gmap.css');
}
示例2: st_add_scripts
function st_add_scripts()
{
if (is_singular()) {
wp_enqueue_script('comment');
wp_enqueue_script('comment-reply');
wp_enqueue_script('st-reviews-form', get_template_directory_uri() . '/js/init/review_form.js', array('jquery'), null, true);
}
wp_enqueue_script('bootstrap-traveler', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), null, true);
wp_enqueue_script('slimmenu', get_template_directory_uri() . '/js/slimmenu.js', array('jquery'), null, true);
wp_enqueue_script('bootstrap-datepicker.js', get_template_directory_uri() . '/js/bootstrap-datepicker.js', array('jquery'), null, true);
wp_enqueue_script('bootstrap-timepicker.js', get_template_directory_uri() . '/js/bootstrap-timepicker.js', array('jquery'), null, true);
wp_enqueue_script('jquery.form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'), null, true);
wp_enqueue_script('ionrangeslider.js', get_template_directory_uri() . '/js/ionrangeslider.js', array('jquery'), null, true);
wp_enqueue_script('icheck.js', get_template_directory_uri() . '/js/icheck.js', array('jquery'), null, true);
wp_enqueue_script('fotorama.js', get_template_directory_uri() . '/js/fotorama.js', array('jquery'), null, true);
wp_register_script('handlebars-v2.0.0.js', get_template_directory_uri() . '/js/handlebars-v2.0.0.js', array(), null, true);
wp_enqueue_script('typeahead.js', get_template_directory_uri() . '/js/typeahead.js', array('jquery', 'handlebars-v2.0.0.js'), null, true);
wp_enqueue_script('magnific.js', get_template_directory_uri() . '/js/magnific.js', array('jquery'), null, true);
wp_enqueue_script('owl-carousel.js', get_template_directory_uri() . '/js/owl-carousel.js', array('jquery'), null, true);
if (is_page_template('template-commingsoon.php')) {
wp_enqueue_script('countdown.js', get_template_directory_uri() . '/js/countdown.js', array('jquery'), null, true);
}
if (is_page_template('template-user.php')) {
if (TravelHelper::is_https()) {
wp_enqueue_script('gmap-api', 'https://maps.google.com/maps/api/js?sensor=false&language=en&libraries=places', null, false, true);
} else {
wp_enqueue_script('gmap-api', 'http://maps.google.com/maps/api/js?sensor=false&language=en&libraries=places', null, false, true);
}
wp_enqueue_script('gmapv3', get_template_directory_uri() . '/inc/plugins/ot-custom/fields/gmap/js/gmap3.min.js', array('jquery', 'gmap-api'), false, true);
wp_enqueue_script('bt-gmapv3-init', get_template_directory_uri() . '/inc/plugins/ot-custom/fields/gmap/js/init.js', array('gmapv3'), false, true);
wp_enqueue_style('bt-gmapv3', get_template_directory_uri() . '/inc/plugins/ot-custom/fields/gmap/css/bt-gmap.css');
}
$locale = get_locale();
if ($locale and $locale != 'en') {
$date_picker_file = get_template_directory_uri() . '/js/locales/bootstrap-datepicker.' . $locale . '.js';
$date_picker_file_path = get_template_directory() . '/js/locales/bootstrap-datepicker.' . $locale . '.js';
if (!file_exists($date_picker_file_path)) {
$locale_array = explode('_', $locale);
if (!empty($locale_array) and $locale_array[0]) {
$locale = $locale_array[0];
}
}
$date_picker_file = get_template_directory_uri() . '/js/locales/bootstrap-datepicker.' . $locale . '.js';
$date_picker_file_path = get_template_directory() . '/js/locales/bootstrap-datepicker.' . $locale . '.js';
if (file_exists($date_picker_file_path)) {
// Datetime l10n
wp_enqueue_script('bootstrap-datepicker-' . $locale . '.js', $date_picker_file, array('jquery'), null, true);
}
}
wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.js', array('jquery'), null, true);
wp_register_script('gridrotator.js', get_template_directory_uri() . '/js/gridrotator.js', array('jquery'), null, true);
if (TravelHelper::is_https()) {
wp_enqueue_script('gmap-apiv3', 'https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places&sensor=false', array(), null, true);
} else {
wp_enqueue_script('gmap-apiv3', 'http://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places&sensor=false', array(), null, true);
}
wp_enqueue_script('markerclusterer.js', get_template_directory_uri() . '/js/markerclusterer.js', array('jquery'), null, true);
wp_register_script('gmaplib', get_template_directory_uri() . '/js/gmap3.js', array('gmap-apiv3'), null, true);
wp_register_script('gmap-init', get_template_directory_uri() . '/js/init/gmap-init.js', array('gmaplib'), null, true);
wp_enqueue_script('gmap-init-list-map', get_template_directory_uri() . '/js/init/init-list-map.js', array('jquery'), null, true);
wp_enqueue_script('gmap-info-box', get_template_directory_uri() . '/js/infobox.js', array('jquery'), null, true);
wp_register_script('jquery.noty', get_template_directory_uri() . '/js/noty/packaged/jquery.noty.packaged.min.js', array('jquery'), null, true);
wp_register_script('st.noty', get_template_directory_uri() . '/js/init/class.notice.js', array('jquery', 'jquery.noty'), null, true);
if (is_singular()) {
wp_enqueue_script('gmap-init');
}
wp_enqueue_script('hotel-ajax', get_template_directory_uri() . '/js/init/hotel-ajax.js', array('jquery'), null, true);
wp_enqueue_script('booking_modal', get_template_directory_uri() . '/js/init/booking_modal.js', array('jquery'), null, true);
wp_enqueue_script('chosen.jquery', get_template_directory_uri() . '/js/chosen/chosen.jquery.min.js', array('jquery'), null, true);
wp_enqueue_script('st.noty');
/**
* @since 1.1.0
**/
if (get_post_type(get_the_ID()) == 'st_rental') {
wp_enqueue_script('rental-js', get_template_directory_uri() . '/js/init/rental-date-ajax.js', array('jquery'), '1.1.0', true);
}
/**
*@since 1.1.7
**/
if (is_singular('hotel_room') || is_singular('st_rental') || is_singular('st_tours') || is_singular('st_holidays')) {
wp_enqueue_script('moment.js', get_template_directory_uri() . '/js/fullcalendar-2.4.0/lib/moment.min.js', array('jquery'), NULL, TRUE);
wp_enqueue_script('fullcalendar', get_template_directory_uri() . '/js/fullcalendar-2.4.0/fullcalendar.min.js', array('jquery'), NULL, TRUE);
wp_enqueue_script('fullcalendar-lang', get_template_directory_uri() . '/js/fullcalendar-2.4.0/lang-all.js', array('jquery'), NULL, TRUE);
wp_enqueue_style('fullcalendar', get_template_directory_uri() . '/js/fullcalendar-2.4.0/fullcalendar.min.css');
wp_enqueue_style('availability', get_template_directory_uri() . '/css/availability.css');
}
if (is_singular('st_rental')) {
wp_enqueue_script('single-rental-js', get_template_directory_uri() . '/js/init/single-rental.js', array('jquery', 'moment.js', 'fullcalendar', 'date.js', 'fullcalendar-lang'), '1.1.0', true);
}
if (is_singular('hotel_room')) {
wp_enqueue_script('single-hotel-room-js', get_template_directory_uri() . '/js/init/single-hotel-room.js', array('jquery', 'moment.js', 'fullcalendar', 'date.js', 'fullcalendar-lang'), '1.1.0', true);
}
if (is_singular('st_hotel')) {
wp_enqueue_script('single-hotel-js', get_template_directory_uri() . '/js/init/single-hotel.js', array('jquery'), '1.1.0', true);
}
if (is_singular('st_tours')) {
wp_enqueue_script('st-qtip', get_template_directory_uri() . '/js/jquery.qtip.js', array('jquery'), null, true);
wp_enqueue_script('single-tour-js', get_template_directory_uri() . '/js/init/single-tour.js', array('jquery'), '1.1.0', true);
}
if (is_singular('st_holidays')) {
//.........这里部分代码省略.........