本文整理汇总了PHP中STInput::get方法的典型用法代码示例。如果您正苦于以下问题:PHP STInput::get方法的具体用法?PHP STInput::get怎么用?PHP STInput::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STInput
的用法示例。
在下文中一共展示了STInput::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: st_post_select_func
function st_post_select_func()
{
if (!current_user_can('upload_files')) {
return;
}
$result = array('total_count' => 0, 'items' => array());
$q = STInput::get('q');
$post_type = STInput::get('post_type');
if ($q) {
if (!$post_type) {
$post_type = 'st_hotel';
}
$arg = array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'post_status' => 'publish');
$author = STInput::get('author');
if ($author) {
$arg = array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'author' => $author, 'post_status' => 'publish');
}
$query = new WP_Query($arg);
while ($query->have_posts()) {
$query->the_post();
$result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID());
}
global $wp_query;
$result['total_count'] = $wp_query->found_posts;
wp_reset_query();
}
echo json_encode($result);
die;
}
示例2: _top_ajax_search
/**
*
*
*
*
* @since 1.0.9
* */
function _top_ajax_search()
{
if (STInput::request('action') != 'st_top_ajax_search') {
return;
}
//Small security
check_ajax_referer('st_search_security', 'security');
$s = STInput::get('s');
$arg = array('post_type' => array('post', 'st_hotel', 'st_rental', 'location', 'st_tours', 'st_holidays', 'st_cars', 'st_activity'), 'posts_per_page' => 10, 's' => $s, 'suppress_filters' => false);
$query = new WP_Query();
$query->is_admin = false;
$query->query($arg);
$r = array();
while ($query->have_posts()) {
$query->the_post();
$post_type = get_post_type(get_the_ID());
$obj = get_post_type_object($post_type);
$item = array('title' => get_the_title(), 'id' => get_the_ID(), 'type' => $obj->labels->singular_name, 'url' => get_permalink(), 'obj' => $obj);
if ($post_type == 'location') {
$item['url'] = home_url(esc_url_raw('?s=&post_type=st_hotel&location_id=' . get_the_ID()));
}
$r['data'][] = $item;
}
wp_reset_query();
echo json_encode($r);
die;
}
示例3: _shop_product_style
function _shop_product_style()
{
$style = st()->get_option('shop_default_list_view', 'grid');
if (STInput::get('view_style')) {
$style = STInput::get('view_style');
}
return $style;
}
示例4: _get_image
static function _get_image()
{
if (STInput::get('st_get_captcha')) {
$key = STInput::get('key');
$captcha = new SimpleCaptcha();
if ($key) {
$captcha->session_var = $key;
}
$captcha->CreateImage();
die;
}
}
示例5: content
protected function content($arg, $content = null)
{
$data = shortcode_atts(array('st_title_form' => '', 'st_post_type' => "st_hotel", 'st_button_search' => __("Search", ST_TEXTDOMAIN)), $arg, 'st_search_form');
extract($data);
$content = st_remove_wpautop($content);
$text = ' <h2>' . $st_title_form . '</h2>
<form role="search" method="get" class="search" action="' . home_url('/') . '">
<input type="hidden" name="s" value="">
<input type="hidden" name="post_type" value="' . $st_post_type . '">
<input type="hidden" name="layout" value="' . STInput::get('layout') . '">
<div class="row">' . $content . '</div>
<button class="btn btn-primary btn-lg" type="submit">' . $st_button_search . '</button>
</form>';
return $text;
}
示例6: _javascript_reload_parentwindow
static function _javascript_reload_parentwindow()
{
if (STInput::get('social_login_success') == 1) {
?>
<script>
window.opener.location.reload();
window.close();
</script>
<?php
die;
}
}
示例7: _init
/**
* @since 1.1.8
*/
static function _init()
{
self::$table_columns = apply_filters('st_order_meta_table_columns', self::$table_columns);
add_action('after_setup_theme', array(__CLASS__, '_check_is_working'));
add_action('st_traveler_do_upgrade_table', array(__CLASS__, '_upgrade_table'));
add_action('st_save_order_item_meta', array(__CLASS__, '_save_data'), 10, 3);
// Re update the Order Meta
add_action('save_post', array(__CLASS__, '_reupdate_normal_booking'), 50);
// Update Status
add_action('st_booking_change_status', array(__CLASS__, '_st_booking_change_status'), 10, 3);
add_action('woocommerce_order_status_changed', array(__CLASS__, '_woocommerce_order_status_changed'), 10, 3);
if (STInput::get('_upgrade_table') and current_user_can('manage_options')) {
self::_upgrade_table();
die;
}
}
示例8: search_location
function search_location()
{
//Small security
check_ajax_referer('st_search_security', 'security');
$s = STInput::get('s');
$arg = array('post_type' => 'location', 'posts_per_page' => 10, 's' => $s);
if ($s) {
}
global $wp_query;
query_posts($arg);
$r = array();
while (have_posts()) {
the_post();
$r['data'][] = array('title' => get_the_title(), 'id' => get_the_ID(), 'type' => __('Location', ST_TEXTDOMAIN));
}
wp_reset_query();
echo json_encode($r);
die;
}
示例9: success_page_validate
/**
* Validate if order is available to show booking infomation
*
* @since 1.0.8
*
* */
function success_page_validate()
{
$order_code = STInput::get('order_code');
$order_token_code = STInput::get('order_token_code');
if ($order_token_code) {
$order_code = STOrder::get_order_id_by_token($order_token_code);
}
$status = get_post_meta($order_code, 'status', true);
$result = true;
if ($status == 'incomplete') {
// try to check payment complete
$paypal = new STPaypal();
$r = $paypal->check_completePurchase($order_code);
if ($r) {
if (isset($r['status'])) {
if ($r['status']) {
$result = true;
update_post_meta($order_code, 'status', 'complete');
$status = 'complete';
//do_action('st_email_after_booking',$order_code);
//do_action('st_booking_submit_form_success',$order_code);
STCart::send_mail_after_booking($order_code, true);
STCart::send_email_confirm($order_code);
do_action('st_booking_change_status', 'complete', $order_code, 'normal_booking');
} elseif (isset($r['message']) and $r['message']) {
$result = false;
STTemplate::set_message($r['message'], 'danger');
}
if (isset($r['redirect_url']) and $r['redirect_url']) {
echo "<script>window.location.href='" . $r['redirect_url'] . "'</script>";
die;
}
}
}
}
if ($status == 'incomplete') {
$result = false;
STTemplate::set_message(__("Sorry! Your payment is incomplete.", ST_TEXTDOMAIN));
}
return $result;
}
示例10: st_post_select_ajax
function st_post_select_ajax()
{
//if(!current_user_can('upload_files')) return;
$result = array('total_count' => 0, 'items' => array());
$q = STInput::get('q');
$post_type = STInput::get('post_type');
if ($q) {
if (!$post_type) {
$post_type = 'st_hotel';
}
query_posts(array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q));
while (have_posts()) {
the_post();
$result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID());
}
global $wp_query;
$result['total_count'] = $wp_query->found_posts;
wp_reset_query();
}
echo json_encode($result);
die;
}
示例11: st_post_select_ajax
function st_post_select_ajax()
{
$result = array('total_count' => 0, 'items' => array());
$q = STInput::get('q');
$post_type = STInput::get('post_type');
$user_id = STInput::get('user_id', '');
if ($q) {
if (!$post_type) {
$post_type = 'st_hotel';
}
query_posts(array('post_type' => $post_type, 'posts_per_page' => 20, 's' => $q, 'author' => $user_id, 'post_status' => array('publish', 'private')));
while (have_posts()) {
the_post();
$result['items'][] = array('id' => get_the_ID(), 'name' => get_the_title(), 'description' => "ID: " . get_the_ID());
}
global $wp_query;
$result['total_count'] = $wp_query->found_posts;
wp_reset_query();
}
echo json_encode($result);
die;
}
示例12: _e
<div class="filter-items">
<div class="alignleft actions">
<input type="text" class="st_datepicker" format="mm/dd/yyyy" name="st_date_start" placeholder="<?php
_e('Filter by Date from', ST_TEXTDOMAIN);
?>
" value="<?php
echo STInput::get('st_date_start');
?>
"/>
<input type="text" class="st_datepicker" name="st_date_end" placeholder="<?php
_e('Filter by Date to', ST_TEXTDOMAIN);
?>
" value="<?php
echo STInput::get('st_date_end');
?>
"/>
<input type="submit" name="filter_action" id="post-query-submit" class="button" value="<?php
_e('Filter', ST_TEXTDOMAIN);
?>
">
</div>
</div>
</div>
</form>
<form id="posts-filter" action="<?php
echo admin_url('edit.php?post_type=st_rental&page=st_rental_booking');
?>
" method="post">
示例13: esc_attr
}
if ($is_required == 'on') {
$is_required = 'required';
}
?>
<div data-date-format="<?php
echo TravelHelper::getDateFormatJs();
?>
" class="form-group input-daterange form-group-<?php
echo esc_attr($field_size);
?>
form-group-icon-left">
<label for="field-hotel-checkout"><?php
echo esc_html($title);
?>
</label>
<i class="fa fa-calendar input-icon input-icon-highlight"></i>
<input id="field-hotel-checkout" <?php
echo esc_attr($is_required);
?>
placeholder="<?php
echo TravelHelper::getDateFormatJs();
?>
" class="form-control <?php
echo esc_attr($is_required);
?>
checkout_hotel" value="<?php
echo STInput::get('end');
?>
" name="end" type="text" />
</div>
示例14: balanceTags
$i_s = '<li><i class="fa fa-star"></i></li>';
for ($k = 1; $k <= $i; $k++) {
echo balanceTags($i_s);
}
?>
</ul>
</label>
</div>
<?php
}
break;
case "taxonomy":
$terms = get_terms($value->taxonomy);
$key = $value->taxonomy;
foreach ($terms as $key2 => $value2) {
$current = STInput::get('taxonomy');
if (isset($current[$key])) {
$current = $current[$value->taxonomy];
} else {
$current = '';
}
$checked = TravelHelper::checked_array(explode(',', $current), $value2->term_id);
if ($checked) {
$link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id, false);
} else {
$link = TravelHelper::build_url_array('taxonomy', $value->taxonomy, $value2->term_id);
}
?>
<div class="checkbox">
<label>
<input <?php
示例15: array
* @package WordPress
* @subpackage Traveler
* @since 1.0
*
* Hotel field room num
*
* Created by ShineTheme
*
*/
$default = array('title' => '');
if (isset($data)) {
extract(wp_parse_args($data, $default));
} else {
extract($default);
}
$old = STInput::get('room_num_search');
if (!isset($field_size)) {
$field_size = 'lg';
}
?>
<div class="form-group form-group-<?php
echo esc_attr($field_size);
?>
form-group-select-plus">
<label><?php
echo esc_html($title);
?>
</label>
<div class="btn-group btn-group-select-num <?php
if ($old >= 4) {
echo 'hidden';