本文整理汇总了PHP中BYT_Theme_Utils::does_file_exist方法的典型用法代码示例。如果您正苦于以下问题:PHP BYT_Theme_Utils::does_file_exist方法的具体用法?PHP BYT_Theme_Utils::does_file_exist怎么用?PHP BYT_Theme_Utils::does_file_exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BYT_Theme_Utils
的用法示例。
在下文中一共展示了BYT_Theme_Utils::does_file_exist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enqueue_scripts_styles
/**
* Enqueues scripts and styles for front-end.
*
* @since Book Your Travel 1.0
*/
function enqueue_scripts_styles()
{
global $wp_styles, $byt_theme_globals;
$language_code = $byt_theme_globals->get_current_language_code();
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
/*
* Adds JavaScript for various theme features
*/
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-slider');
wp_enqueue_script('jquery-ui-datepicker');
if (BYT_Theme_Utils::does_file_exist('/js/i18n/datepicker-' . $language_code . '.js')) {
wp_register_script('bookyourtravel-datepicker-' . $language_code, BYT_Theme_Utils::get_file_uri('/js/i18n/datepicker-' . $language_code . '.js'), array('jquery', 'jquery-ui-datepicker'), '1.0', true);
wp_enqueue_script('bookyourtravel-datepicker-' . $language_code);
}
wp_enqueue_script('jquery-effects-core');
wp_enqueue_script('bookyourtravel-jquery-validate', BYT_Theme_Utils::get_file_uri('/js/jquery.validate.min.js'), array('jquery'), '1.0', true);
wp_enqueue_script('bookyourtravel-extras-jquery-validate', BYT_Theme_Utils::get_file_uri('/js/extras.jquery.validate.js'), array('bookyourtravel-jquery-validate'), '1.0', true);
wp_enqueue_script('bookyourtravel-jquery-prettyPhoto', BYT_Theme_Utils::get_file_uri('/js/jquery.prettyPhoto.js'), array('jquery'), '1.0', true);
wp_enqueue_script('bookyourtravel-jquery-raty', BYT_Theme_Utils::get_file_uri('/js/jquery.raty.min.js'), array('jquery'), '1.0', true);
wp_enqueue_script('bookyourtravel-jquery-uniform', BYT_Theme_Utils::get_file_uri('/js/jquery.uniform.min.js'), array('jquery'), '1.0', true);
wp_enqueue_script('bookyourtravel-mediaqueries', BYT_Theme_Utils::get_file_uri('/js/respond.js'), array('jquery'), '1.0', true);
wp_enqueue_script('bookyourtravel-selectnav', BYT_Theme_Utils::get_file_uri('/js/selectnav.js'), array('jquery', 'bookyourtravel-jquery-uniform'), '1.0', true);
wp_enqueue_script('bookyourtravel-scripts', BYT_Theme_Utils::get_file_uri('/js/scripts.js'), array('jquery', 'bookyourtravel-selectnav', 'bookyourtravel-jquery-uniform'), '1.0', true);
$page_object = get_queried_object();
$page_id = get_queried_object_id();
if (is_single()) {
wp_enqueue_script('bookyourtravel-jquery-lightSlider', BYT_Theme_Utils::get_file_uri('/includes/plugins/lightSlider/js/jquery.lightSlider.js'), 'jquery', '1.0', true);
wp_enqueue_style('bookyourtravel-lightSlider-style', BYT_Theme_Utils::get_file_uri('/includes/plugins/lightSlider/css/lightSlider.css'));
wp_enqueue_script('bookyourtravel-jquery-responsive-tables', BYT_Theme_Utils::get_file_uri('/js/responsive-tables.js'), 'jquery', '1.0', true);
wp_enqueue_style('bookyourtravel-responsive-tables-style', BYT_Theme_Utils::get_file_uri('/css/responsive-tables.css'));
}
if (is_page()) {
$template_file = get_post_meta($page_id, '_wp_page_template', true);
if ($template_file == 'page-user-account.php') {
wp_enqueue_script('bookyourtravel-user-account', BYT_Theme_Utils::get_file_uri('/js/account.js'), 'jquery', '1.0', true);
} elseif ($template_file == 'page-user-submit-content.php') {
wp_enqueue_script('bookyourtravel-frontend-submit', BYT_Theme_Utils::get_file_uri('/includes/plugins/frontend-submit/frontend-submit.js'), array('jquery', 'bookyourtravel-jquery-validate'), '1.0', true);
}
}
if (is_single() && get_post_type() == 'accommodation') {
wp_enqueue_script('bookyourtravel-google-maps', '//maps.google.com/maps/api/js?sensor=false', 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-infobox', BYT_Theme_Utils::get_file_uri('/js/infobox.js'), 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-tablesorter', BYT_Theme_Utils::get_file_uri('/js/jquery.tablesorter.min.js'), 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-accommodations', BYT_Theme_Utils::get_file_uri('/js/accommodations.js'), array('jquery', 'bookyourtravel-scripts'), '1.0', true);
wp_enqueue_script('bookyourtravel-reviews', BYT_Theme_Utils::get_file_uri('/js/reviews.js'), 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-inquiry', BYT_Theme_Utils::get_file_uri('/js/inquiry.js'), 'jquery', '1.0', true);
} else {
if (is_single() && get_post_type() == 'location') {
wp_enqueue_script('bookyourtravel-locations', BYT_Theme_Utils::get_file_uri('/js/locations.js'), 'jquery', '1.0', true);
} else {
if (is_single() && get_post_type() == 'tour') {
wp_enqueue_script('bookyourtravel-google-maps', '//maps.google.com/maps/api/js?sensor=false', 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-tours', BYT_Theme_Utils::get_file_uri('/js/tours.js'), array('jquery', 'bookyourtravel-scripts'), '1.0', true);
wp_enqueue_script('bookyourtravel-reviews', BYT_Theme_Utils::get_file_uri('/js/reviews.js'), 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-inquiry', BYT_Theme_Utils::get_file_uri('/js/inquiry.js'), 'jquery', '1.0', true);
} else {
if (is_single() && get_post_type() == 'cruise') {
wp_enqueue_script('bookyourtravel-google-maps', '//maps.google.com/maps/api/js?sensor=false', 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-cruises', BYT_Theme_Utils::get_file_uri('/js/cruises.js'), array('jquery', 'bookyourtravel-scripts'), '1.0', true);
wp_enqueue_script('bookyourtravel-reviews', BYT_Theme_Utils::get_file_uri('/js/reviews.js'), 'jquery', '1.0', true);
wp_enqueue_script('bookyourtravel-inquiry', BYT_Theme_Utils::get_file_uri('/js/inquiry.js'), 'jquery', '1.0', true);
} else {
if (is_single() && get_post_type() == 'car_rental') {
wp_enqueue_script('bookyourtravel-car_rentals', BYT_Theme_Utils::get_file_uri('/js/car_rentals.js'), array('jquery', 'bookyourtravel-scripts'), '1.0', true);
wp_enqueue_script('bookyourtravel-inquiry', BYT_Theme_Utils::get_file_uri('/js/inquiry.js'), 'jquery', '1.0', true);
}
}
}
}
}
$ajaxurl = admin_url('admin-ajax.php');
global $sitepress;
if ($sitepress) {
$lang = $sitepress->get_current_language();
$ajaxurl = admin_url('admin-ajax.php?lang=' . $lang);
}
wp_localize_script('bookyourtravel-scripts', 'BYTAjax', array('ajaxurl' => $ajaxurl, 'nonce' => wp_create_nonce('byt-ajax-nonce')));
/*
* Loads our main stylesheets.
*/
wp_enqueue_style('bookyourtravel-style-main', BYT_Theme_Utils::get_file_uri('/css/style.css'), array(), '1.0', "screen,projection,print");
wp_enqueue_style('bookyourtravel-style', get_stylesheet_uri());
if ($byt_theme_globals->enable_rtl()) {
wp_enqueue_style('bookyourtravel-style-rtl', BYT_Theme_Utils::get_file_uri('/css/style-rtl.css'), array(), '1.0', "screen,projection,print");
}
/*
* Load the color scheme sheet if set in set in options.
//.........这里部分代码省略.........