本文整理汇总了PHP中BYT_Theme_Utils类的典型用法代码示例。如果您正苦于以下问题:PHP BYT_Theme_Utils类的具体用法?PHP BYT_Theme_Utils怎么用?PHP BYT_Theme_Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BYT_Theme_Utils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tour_schedule_admin_styles
function tour_schedule_admin_styles()
{
if (isset($_POST['start_date'])) {
$start_date = wp_kses($_POST['start_date'], '');
}
echo '<style type="text/css">';
echo ' .wp-list-table .column-Id { width: 100px; }';
echo ' .wp-list-table .column-TourName { width: 150px; }';
echo ' .wp-list-table .column-TourType { width: 150px; }';
echo ' .wp-list-table .column-StartDate { width: 150px; }';
echo ' .wp-list-table .column-EndDate { width: 150px; }';
echo ' .wp-list-table .column-MaxPeople { width: 100px; }';
echo ' .wp-list-table .column-DurationDays { width: 100px; }';
echo ' .wp-list-table .column-Action { width: 100px; }';
echo ' table.calendar { width:60%; }
table.calendar th { text-align:center; }
table.calendar td { border:none;text-align:center;height:30px;line-height:30px;vertical-align:middle; }
table.calendar td.sel a { color:#fff;padding:10px;background:#b1b1b1; }
table.calendar td.cur a { color:#fff;padding:10px;background:#ededed; }';
echo "</style>";
echo '<script>';
echo 'window.adminAjaxUrl = "' . admin_url('admin-ajax.php') . '";';
echo 'window.datepickerDateFormat = "' . BYT_Theme_Utils::dateformat_PHP_to_jQueryUI(get_option('date_format')) . '";';
echo 'window.datepickerAltFormat = "' . BOOKYOURTRAVEL_ALT_DATE_FORMAT . '";';
echo '</script>';
}
示例2: list_locations
function list_locations($location_id = 0, $paged = 0, $per_page = -1, $orderby = '', $order = '', $featured_only = false)
{
$location_ids = array();
if ($location_id > 0) {
$location_ids[] = $location_id;
$location_descendants = BYT_Theme_Utils::get_post_descendants($location_id, 'location');
foreach ($location_descendants as $location) {
$location_ids[] = $location->ID;
}
}
$args = array('post_type' => 'location', 'post_status' => array('publish'), 'posts_per_page' => $per_page, 'paged' => $paged, 'orderby' => $orderby, 'suppress_filters' => false, 'order' => $order, 'meta_query' => array('relation' => 'AND'));
if (count($location_ids) > 0) {
$args['meta_query'][] = array('key' => 'location_location_post_id', 'value' => $location_ids, 'compare' => 'IN');
}
if (isset($featured_only) && $featured_only) {
$args['meta_query'][] = array('key' => 'location_is_featured', 'value' => 1, 'compare' => '=', 'type' => 'numeric');
}
$posts_query = new WP_Query($args);
$locations = array();
if ($posts_query->have_posts()) {
while ($posts_query->have_posts()) {
global $post;
$posts_query->the_post();
$locations[] = $post;
}
}
$results = array('total' => $posts_query->found_posts, 'results' => $locations);
wp_reset_postdata();
return $results;
}
示例3: __construct
function __construct()
{
add_action('init', array($this, 'action_init'));
$this->allowed_mime_types = function_exists('wp_get_mime_types') ? wp_get_mime_types() : get_allowed_mime_types();
$this->has_correct_role = BYT_Theme_Utils::check_user_role(BOOKYOURTRAVEL_FRONTEND_SUBMIT_ROLE, $this->get_current_user_id());
$this->_html_helper = new Html_Helper();
}
示例4: get_type_day_of_week_day
public function get_type_day_of_week_day()
{
$day_of_week_index = $this->get_type_day_of_week_index();
$days_of_week = BYT_Theme_Utils::get_days_of_week();
if ($day_of_week_index > -1) {
return $days_of_week[$day_of_week_index];
}
return '';
}
示例5: bookings_admin_styles
function bookings_admin_styles()
{
echo '<style type="text/css">';
echo '.wp-list-table .column-Id { width: 100px; }';
echo '.wp-list-table .column-TourName { width: 250px; }';
echo '.wp-list-table .column-TourDate { width: 150px; }';
echo '.wp-list-table .column-People { width: 100px; }';
echo '.wp-list-table .column-UserId { width: 50px; }';
echo '</style>';
echo '<script>';
echo 'window.adminAjaxUrl = "' . admin_url('admin-ajax.php') . '";';
echo 'window.datepickerDateFormat = "' . BYT_Theme_Utils::dateformat_PHP_to_jQueryUI(get_option('date_format')) . '";';
echo 'window.datepickerAltFormat = "' . BOOKYOURTRAVEL_ALT_DATE_FORMAT . '";';
echo '</script>';
}
示例6: __
<?php
BYT_Theme_Utils::render_field("min_age", "", __('Minimum driver age', 'bookyourtravel'), $car_rental_obj->get_custom_field('min_age'), '', false, true);
?>
<?php
BYT_Theme_Utils::render_field("transmission", "", __('Transmission', 'bookyourtravel'), $car_rental_obj->get_custom_field('transmission_type') == 'manual' ? __('Manual', 'bookyourtravel') : __('Automatic', 'bookyourtravel'), '', false, true);
?>
<?php
BYT_Theme_Utils::render_field("air_conditioned", "", __('Air-conditioned?', 'bookyourtravel'), $car_rental_obj->get_custom_field('is_air_conditioned') ? __('Yes', 'bookyourtravel') : __('No', 'bookyourtravel'), '', false, true);
?>
<?php
BYT_Theme_Utils::render_field("unlimited_mileage", "", __('Unlimited mileage?', 'bookyourtravel'), $car_rental_obj->get_custom_field('is_unlimited_mileage') ? __('Yes', 'bookyourtravel') : __('No', 'bookyourtravel'), '', false, true);
?>
</div>
<?php
echo "<div class='actions'>";
BYT_Theme_Utils::render_link_button($car_rental_obj->get_permalink(), "gradient-button", "", __('Book now', 'bookyourtravel'));
echo "</div>";
?>
</div>
</div>
</article>
<!--//car rental item-->
<?php
} else {
?>
<li>
<a href="<?php
echo esc_url($car_rental_obj->get_permalink());
?>
">
<h3><?php
示例7: do_action
</article>
</section>
<!--//location-->
<?php
}
?>
<?php
if ($enable_reviews) {
?>
<!--reviews-->
<section id="reviews" class="tab-content <?php
echo $first_display_tab == 'review' ? 'initial' : '';
?>
">
<?php
do_action('byt_show_single_accommodation_reviews_before');
get_template_part('includes/parts/review', 'item');
BYT_Theme_Utils::render_tab_extra_fields('accommodation_extra_fields', $accommodation_extra_fields, 'reviews', $accommodation_obj);
do_action('byt_show_single_accommodation_reviews_after');
?>
</section>
<!--//reviews-->
<?php
}
// if ($enable_reviews)
?>
<?php
if ($accommodation_location != null) {
?>
<!--things to do-->
<section id="things-to-do" class="tab-content <?php
示例8: esc_attr
$all_empty_fields = BYT_Theme_Utils::are_tab_fields_empty('tour_extra_fields', $tour_extra_fields, $tab['id'], $tour_obj);
if (!$all_empty_fields) {
?>
<section id="<?php
echo esc_attr($tab['id']);
?>
" class="tab-content <?php
echo $first_display_tab == $tab['id'] ? 'initial' : '';
?>
">
<article>
<?php
do_action('byt_show_single_tour_' . $tab['id'] . '_before');
?>
<?php
BYT_Theme_Utils::render_tab_extra_fields('tour_extra_fields', $tour_extra_fields, $tab['id'], $tour_obj);
?>
<?php
do_action('byt_show_single_tour_' . $tab['id'] . '_after');
?>
</article>
</section>
<?php
}
}
}
do_action('byt_show_single_tour_tab_content_after');
?>
</section>
<!--//tour content-->
<?php
示例9: repeat_review_field_option_type
function repeat_review_field_option_type($option_name, $option, $values)
{
global $byt_theme_of_default_fields;
$counter = 0;
$default_values = $byt_theme_of_default_fields->get_default_review_fields_array($option['id']);
if (!is_array($values) || count($values) == 0) {
$values = $default_values;
}
$post_type = '';
if ($option['id'] == 'accommodation_review_fields') {
$post_type = 'accommodation';
} elseif ($option['id'] == 'tour_review_fields') {
$post_type = 'tour';
} elseif ($option['id'] == 'cruise_review_fields') {
$post_type = 'cruise';
}
$output = '<div class="of-repeat-loop">';
$output .= '<ul class="sortable of-repeat-review-fields">';
if (is_array($values)) {
foreach ((array) $values as $key => $value) {
if (isset($value['label']) && isset($value['post_type']) && isset($value['id'])) {
$output .= '<li class="ui-state-default of-repeat-group">';
$output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="input-field-id" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][id]') . '" type="hidden" value="' . esc_attr($value['id']) . '" />';
$output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][post_type]') . '" type="hidden" value="' . $post_type . '" />';
$output .= '<div class="of-input-wrap">';
$output .= '<label data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-label label-field-label" for="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][label]') . '">' . __('Field label', 'bookyourtravel') . '</label>';
$output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-input input-field-label" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][label]') . '" type="text" value="' . esc_attr($value['label']) . '" />';
$output .= '</div>';
$output .= '<label data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-label label-hide-field" for="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][hide]') . '">' . __('Is hidden?', 'bookyourtravel') . '</label>';
$output .= '<input data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" class="of-checkbox checkbox-hide-field" name="' . esc_attr($option_name . '[' . $option['id'] . '][' . $counter . '][hide]') . '" type="checkbox" value="1" ' . (isset($value['hide']) && $value['hide'] == '1' ? 'checked' : '') . ' />';
if (isset($value['id']) && isset($value['label']) && count(BYT_Theme_Utils::custom_array_search($default_values, 'id', $value['id'])) == 0) {
$output .= '<span class="ui-icon ui-icon-close"></span>';
}
$output .= '</li><!--.of-repeat-group-->';
$counter++;
}
}
}
$output .= '<li class="to-copy ui-state-default of-repeat-group">';
$output .= '<input class="input-post-type" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="hidden" value="' . $post_type . '" />';
$output .= '<div class="of-input-wrap">';
$output .= '<label class="of-label label-field-label" for="' . esc_attr($option_name . '[' . $option['id'] . ']') . '">' . __('Field label', 'bookyourtravel') . '</label>';
$output .= '<input class="of-input input-field-label" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="text" value="' . esc_attr($option['std']) . '" />';
$output .= '</div>';
$output .= '<label class="of-label label-hide-field" for="' . esc_attr($option_name . '[' . $option['id'] . ']') . '">' . __('Is hidden?', 'bookyourtravel') . '</label>';
$output .= '<input class="of-checkbox checkbox-hide-field" data-rel="' . esc_attr($option_name . '[' . $option['id'] . ']') . '" type="checkbox" value="1" />';
$output .= '<span class="ui-icon ui-icon-close"></span>';
$output .= '</li><!--.of-repeat-group-->';
$output .= '</ul><!--.sortable-->';
$output .= '<a href="#" class="docopy_review_field button icon add">' . __('Add review field', 'bookyourtravel') . '</a>';
$output .= '</div><!--.of-repeat-loop-->';
return $output;
}
示例10: mt_rand
<?php
global $byt_theme_globals;
$terms_page_url = $byt_theme_globals->get_terms_page_url();
$add_captcha_to_forms = $byt_theme_globals->add_captcha_to_forms();
$enc_key = $byt_theme_globals->get_enc_key();
$register_page_url = $byt_theme_globals->get_register_page_url();
$c_val_1_reg = mt_rand(1, 20);
$c_val_2_reg = mt_rand(1, 20);
$c_val_1_reg_str = BYT_Theme_Utils::encrypt($c_val_1_reg, $enc_key);
$c_val_2_reg_str = BYT_Theme_Utils::encrypt($c_val_2_reg, $enc_key);
?>
<div class="lightbox" style="display:none;" id="register_lightbox">
<div class="lb-wrap">
<a onclick="toggleLightbox('register_lightbox');" href="javascript:void(0);" class="close">x</a>
<div class="lb-content">
<form action="<?php
echo esc_url($register_page_url);
?>
" method="post">
<h1><?php
_e('Register', 'bookyourtravel');
?>
</h1>
<div class="f-item">
<label for="user_login"><?php
_e('Username', 'bookyourtravel');
?>
</label>
<input tabindex="27" type="text" id="user_login" name="user_login" />
</div>
示例11: get_home_url
$reset_password_page_url = $byt_theme_globals->get_reset_password_page_url();
$terms_page_url = $byt_theme_globals->get_terms_page_url();
$redirect_to_after_login_url = $byt_theme_globals->get_redirect_to_after_login_page_url();
if (!$redirect_to_after_login_url) {
$redirect_to_after_login_url = get_home_url();
}
$login = null;
if (isset($_POST['log']) && isset($_POST['bookyourtravel_login_form_nonce']) && wp_verify_nonce($_POST['bookyourtravel_login_form_nonce'], 'bookyourtravel_login_form')) {
$login = wp_signon(array('user_login' => $_POST['log'], 'user_password' => $_POST['pwd'], 'remember' => isset($_POST['rememberme']) && $_POST['rememberme'] ? true : false), false);
if (!is_wp_error($login)) {
wp_redirect($redirect_to_after_login_url);
exit;
}
}
get_header();
BYT_Theme_Utils::breadcrumbs();
get_sidebar('under-header');
global $post;
$page_id = $post->ID;
$page_custom_fields = get_post_custom($page_id);
$page_sidebar_positioning = null;
if (isset($page_custom_fields['page_sidebar_positioning'])) {
$page_sidebar_positioning = $page_custom_fields['page_sidebar_positioning'][0];
$page_sidebar_positioning = empty($page_sidebar_positioning) ? '' : $page_sidebar_positioning;
}
$section_class = 'three-fourth';
if ($page_sidebar_positioning == 'both') {
$section_class = 'one-half';
} else {
if ($page_sidebar_positioning == 'left' || $page_sidebar_positioning == 'right') {
$section_class = 'three-fourth';
示例12: _e
<p><?php
_e('We apologize for any inconvenience, please hit back on your browser or if you are an admin, enter some content.', 'bookyourtravel');
?>
</p>
</div>
</article>
<?php
}
?>
<!--bottom navigation-->
<nav class="page-navigation bottom-nav">
<a href="#" class="scroll-to-top" title="<?php
esc_attr_e('Back up', 'bookyourtravel');
?>
"><?php
_e('Back up', 'bookyourtravel');
?>
</a>
<div class="pager">
<?php
global $wp_query;
BYT_Theme_Utils::display_pager($wp_query->max_num_pages);
?>
</div>
</nav>
<!--//bottom navigation-->
</section>
<!--//three-fourth content-->
<?php
get_sidebar('right');
get_footer();
示例13: esc_attr_e
</div>
<nav class="page-navigation bottom-nav">
<!--back up button-->
<a href="#" class="scroll-to-top" title="<?php
esc_attr_e('Back up', 'bookyourtravel');
?>
"><?php
_e('Back up', 'bookyourtravel');
?>
</a>
<!--//back up button-->
<!--pager-->
<div class="pager">
<?php
$total_results = $accommodation_results['total'];
BYT_Theme_Utils::display_pager(ceil($total_results / $posts_per_page));
?>
</div>
</nav>
<?php
}
// end if ( $query->have_posts() )
?>
</div><!--//deals clearfix-->
</section>
<?php
wp_reset_postdata();
wp_reset_query();
if ($page_sidebar_positioning == 'both' || $page_sidebar_positioning == 'right') {
get_sidebar('right');
}
示例14: byt_post
<?php
global $post, $post_class, $display_mode, $byt_theme_globals, $byt_posts_post_type;
$post_id = $post->ID;
$post_obj = new byt_post($post);
$base_id = $post_obj->get_base_id();
$post_image = $post_obj->get_main_image();
if (empty($post_image)) {
$post_image = BYT_Theme_Utils::get_file_uri('/images/uploads/img.jpg');
}
if (empty($display_mode) || $display_mode == 'card') {
?>
<!--post-->
<article class=" <?php
echo $post_class;
?>
">
<div>
<?php
if (!empty($post_image)) {
?>
<figure>
<a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
"><img src="<?php
echo esc_url($post_image);
?>
示例15: number_format_i18n
?>
<p>
<?php
$price_string = '';
if (!$show_currency_symbol_after) {
$price_string = '<span class="curr">' . $default_currency_symbol . '</span>';
$price_string .= '<span class="amount">' . number_format_i18n($tour_min_price, $price_decimal_places) . '</span>';
} else {
$price_string = '<span class="amount">' . number_format_i18n($tour_min_price, $price_decimal_places) . '</span>';
$price_string .= '<span class="curr">' . $default_currency_symbol . '</span>';
}
if (!$is_price_per_group) {
echo sprintf(__('From %s per person', 'bookyourtravel'), $price_string);
} else {
echo sprintf(__('From %s per group', 'bookyourtravel'), $price_string);
}
?>
</p>
<?php
}
?>
<?php
if ($score_out_of_10 > 0) {
// display score out of 10
BYT_Theme_Utils::render_field("", "rating", $score_out_of_10 . ' / 10', "", '', false, false);
}
?>
</a>
</li>
<?php
}