本文整理汇总了PHP中_admin_search_query函数的典型用法代码示例。如果您正苦于以下问题:PHP _admin_search_query函数的具体用法?PHP _admin_search_query怎么用?PHP _admin_search_query使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_admin_search_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search_box
/**
* Show the search field
*
* @since 1.5
* @access public
*
* @param string $text Label for the search box
* @param string $input_id ID of the search box
*
* @return void
*/
public function search_box($text, $input_id)
{
$input_id = $input_id . '-search-input';
if (!empty($_REQUEST['orderby'])) {
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST['orderby']) . '" />';
}
if (!empty($_REQUEST['order'])) {
echo '<input type="hidden" name="order" value="' . esc_attr($_REQUEST['order']) . '" />';
}
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php
echo $input_id;
?>
"><?php
echo $text;
?>
:</label>
<input type="search" id="<?php
echo $input_id;
?>
" name="s" value="<?php
_admin_search_query();
?>
" />
<?php
submit_button($text, 'button', false, false, array('ID' => 'search-submit'));
?>
</p>
<?php
}
示例2: search_box
function search_box($text, $input_id)
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$input_id = $input_id . '-search-input';
if (!empty($_REQUEST['orderby'])) {
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST['orderby']) . '" />';
}
if (!empty($_REQUEST['order'])) {
echo '<input type="hidden" name="order" value="' . esc_attr($_REQUEST['order']) . '" />';
}
?>
<p class="search-box">
<span class="description"><?php
_e('Repository search:', 'installer');
?>
</span>
<input type="search" id="<?php
echo $input_id;
?>
" name="s" value="<?php
_admin_search_query();
?>
" />
<select name="search_type">
<option <?php
echo isset($_POST['search_type']) && $_POST['search_type'] == '0' ? 'selected' : '';
?>
value="0"><?php
_e('All repository types', 'installer');
?>
</option>
<option <?php
echo isset($_POST['search_type']) && $_POST['search_type'] == '1' ? 'selected' : '';
?>
value="1"><?php
_e('Plugins repositories', 'installer');
?>
</option>
<option <?php
echo isset($_POST['search_type']) && $_POST['search_type'] == '2' ? 'selected' : '';
?>
value="2"><?php
_e('Themes repositories', 'installer');
?>
</option>
</select>
<?php
submit_button($text, 'button', false, false, array('id' => 'search-submit'));
?>
</p>
<?php
}
示例3: search_box
/**
* Display the search box.
*
* @since 3.1.0
* @access public
*
* @param string $text The search button text
* @param string $input_id The search input id
*/
function search_box( $text, $input_id ) {
if ( empty( $_REQUEST['s'] ) && !$this->has_items() ) {
return;
}
$input_id = $input_id . '-search-input';
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
<input type="text" id="<?php echo $input_id ?>" name="wpi_search[s]" value="<?php _admin_search_query(); ?>" />
<?php /* submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); */ ?>
</p>
<?php
}
示例4: search_box
public function search_box($text, $wrap_attr = '')
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
parse_str($query, $arr);
$inputs = '';
foreach ($arr as $k => $v) {
$inputs .= '<input type="hidden" name="' . esc_attr($k) . '" value="' . esc_attr($v) . '">';
}
?>
<form action="" method="get" class="search-form">
<?php
echo $inputs;
?>
<p class="polls-search-box" <?php
echo $wrap_attr;
?>
>
<label class="screen-reader-text"><?php
echo $text;
?>
:</label>
<input type="search" name="s" value="<?php
_admin_search_query();
?>
" />
<?php
submit_button($text, 'button', '', false, array('id' => 'search-submit'));
?>
</p>
</form>
<?php
}
示例5: search_box
public function search_box($text, $input_id)
{
$input_id = $input_id . '-search-input';
$total_items = $this->count_subscribers();
if (empty($total_items)) {
return;
}
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php
echo $input_id;
?>
"><?php
echo $text;
?>
:</label>
<input type="search" id="<?php
echo $input_id;
?>
" name="s" value="<?php
_admin_search_query();
?>
" />
<?php
submit_button($text, 'button', '', false, array('id' => 'search-submit'));
?>
</p>
<?php
}
示例6: process_actions
/**
* Handle activate & cancel actions for both individual items and bulk edit.
*
* @since 1.0
*/
public function process_actions()
{
if ($this->current_action() === false) {
return;
}
$messages = array();
$error_messages = array();
// Single subscription action
if (isset($_GET['subscription'])) {
if (!wp_verify_nonce($_REQUEST['_wpnonce'], $_GET['subscription'])) {
wp_die(__('Action failed. Invalid Nonce.', WC_Subscriptions::$text_domain));
}
if (!WC_Subscriptions_Manager::can_subscription_be_changed_to($_GET['new_status'], $_GET['subscription'], $_GET['user'])) {
$error_messages[] = sprintf(__('Error: Subscription status can not be changed to "%s".', WC_Subscriptions::$text_domain), esc_html($_GET['new_status']));
} else {
switch ($_GET['new_status']) {
case 'active':
WC_Subscriptions_Manager::reactivate_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription activated.', WC_Subscriptions::$text_domain);
break;
case 'on-hold':
WC_Subscriptions_Manager::put_subscription_on_hold($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription put on-hold.', WC_Subscriptions::$text_domain);
break;
case 'cancelled':
WC_Subscriptions_Manager::cancel_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription cancelled.', WC_Subscriptions::$text_domain);
break;
case 'trash':
WC_Subscriptions_Manager::trash_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription trashed.', WC_Subscriptions::$text_domain);
break;
case 'deleted':
WC_Subscriptions_Manager::delete_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription deleted.', WC_Subscriptions::$text_domain);
break;
default:
$error_messages[] = __('Error: Unknown subscription status.', WC_Subscriptions::$text_domain);
break;
}
}
} else {
if (isset($_GET['subscription_keys'])) {
// Bulk actions
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'bulk-' . $this->_args['plural'])) {
wp_die(__('Bulk edit failed. Invalid Nonce.', WC_Subscriptions::$text_domain));
}
$subscriptions = $_GET['subscription_keys'];
$subscription_count = 0;
$error_count = 0;
if (in_array($this->current_action(), array('trash', 'deleted'))) {
foreach ($subscriptions as $user_id => $subscription_keys) {
foreach ($subscription_keys as $subscription_key) {
if (!WC_Subscriptions_Manager::can_subscription_be_changed_to($this->current_action(), $subscription_key, $user_id)) {
$error_count++;
} else {
$subscription_count++;
if ('trash' == $this->current_action()) {
WC_Subscriptions_Manager::trash_subscription($user_id, $subscription_key);
} else {
WC_Subscriptions_Manager::delete_subscription($user_id, $subscription_key);
}
}
}
}
if ($subscription_count > 0) {
if ('trash' == $this->current_action()) {
$messages[] = sprintf(_n('%d subscription moved to trash.', '%s subscriptions moved to trash.', $subscription_count, WC_Subscriptions::$text_domain), $subscription_count);
} else {
$messages[] = sprintf(_n('%d subscription deleted.', '%s subscriptions deleted.', $subscription_count, WC_Subscriptions::$text_domain), $subscription_count);
}
}
if ($error_count > 0) {
if ('trash' == $this->current_action()) {
$error_messages[] = sprintf(_n('%d subscription could not be trashed - is it active or on-hold? Try cancelling it before trashing it.', '%s subscriptions could not be trashed - are they active or on-hold? Try cancelling them before trashing.', $error_count, WC_Subscriptions::$text_domain), $error_count);
} else {
$error_messages[] = sprintf(_n('%d subscription could not deleted - is it active or on-hold? Try cancelling it before deleting.', '%s subscriptions could not deleted - are they active or on-hold? Try cancelling them before deleting.', $error_count, WC_Subscriptions::$text_domain), $error_count);
}
}
}
}
}
$status = isset($_GET['status']) ? $_GET['status'] : 'all';
$message_nonce = wp_create_nonce(__FILE__);
set_transient($this->message_transient_prefix . $message_nonce, array('messages' => $messages, 'error_messages' => $error_messages), 60 * 60);
$query_args = array('status' => $status, 'message' => $message_nonce);
$search_query = _admin_search_query();
if (!empty($search_query)) {
$query_args['s'] = $search_query;
}
$redirect_to = add_query_arg($query_args, admin_url('admin.php?page=subscriptions'));
// Redirect to avoid performning actions on a page refresh
wp_safe_redirect($redirect_to);
exit;
}
示例7: _e
?>
</h3>
<?php
if (!empty($_REQUEST['s']) || !empty($_REQUEST['filter']) || $wp_list_table->has_items()) {
?>
<form class="search-form filter-form" action="" method="get">
<p class="search-box">
<label class="screen-reader-text" for="theme-search-input"><?php
_e('Search Installed Themes');
?>
:</label>
<input type="text" id="theme-search-input" name="s" value="<?php
_admin_search_query();
?>
" />
<?php
submit_button(__('Search Installed Themes'), 'button', false, false, array('id' => 'search-submit'));
?>
<a id="filter-click" href="?filter=1"><?php
_e('Feature Filter');
?>
</a>
</p>
<br class="clear"/>
<div id="filter-box" style="<?php
if (empty($_REQUEST['filter'])) {
示例8: bbp_admin_repair_list_search_form
/**
* Output the repair list search form
*
* @since 2.6.0 bbPress (r5885)
*/
function bbp_admin_repair_list_search_form()
{
?>
<p class="search-box">
<label class="screen-reader-text" for="bbp-repair-search-input"><?php
esc_html_e('Search Tools:', 'bbpress');
?>
</label>
<input type="search" id="bbp-repair-search-input" name="s" value="<?php
_admin_search_query();
?>
">
<input type="submit" id="search-submit" class="button" value="<?php
esc_html_e('Search Tools', 'bbpress');
?>
">
</p>
<?php
}
示例9: process_actions
//.........这里部分代码省略.........
$messages[] = __('Subscription activated.', WC_Subscriptions::$text_domain);
break;
case 'on-hold':
WC_Subscriptions_Manager::put_subscription_on_hold($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription put on-hold.', WC_Subscriptions::$text_domain);
break;
case 'cancelled':
WC_Subscriptions_Manager::cancel_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription cancelled.', WC_Subscriptions::$text_domain);
break;
case 'trash':
WC_Subscriptions_Manager::trash_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription trashed.', WC_Subscriptions::$text_domain);
break;
case 'deleted':
WC_Subscriptions_Manager::delete_subscription($_GET['user'], $_GET['subscription']);
$messages[] = __('Subscription deleted.', WC_Subscriptions::$text_domain);
break;
default:
$error_messages[] = __('Error: Unknown subscription status.', WC_Subscriptions::$text_domain);
break;
}
}
} else {
if (isset($_GET['subscription_keys'])) {
// Bulk actions
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'bulk-' . $this->_args['plural'])) {
wp_die(__('Bulk edit failed. Invalid Nonce.', WC_Subscriptions::$text_domain));
}
$subscriptions = $_GET['subscription_keys'];
$subscription_count = 0;
$error_count = 0;
if (in_array($this->current_action(), array('trash', 'deleted'))) {
foreach ($subscriptions as $user_id => $subscription_keys) {
foreach ($subscription_keys as $subscription_key) {
if (!WC_Subscriptions_Manager::can_subscription_be_changed_to($this->current_action(), $subscription_key, $user_id)) {
$error_count++;
} else {
$subscription_count++;
if ('trash' == $this->current_action()) {
WC_Subscriptions_Manager::trash_subscription($user_id, $subscription_key);
} else {
WC_Subscriptions_Manager::delete_subscription($user_id, $subscription_key);
}
}
}
}
if ($subscription_count > 0) {
if ('trash' == $this->current_action()) {
$messages[] = sprintf(_n('%d subscription moved to trash.', '%s subscriptions moved to trash.', $subscription_count, WC_Subscriptions::$text_domain), $subscription_count);
} else {
$messages[] = sprintf(_n('%d subscription deleted.', '%s subscriptions deleted.', $subscription_count, WC_Subscriptions::$text_domain), $subscription_count);
}
}
if ($error_count > 0) {
if ('trash' == $this->current_action()) {
$error_messages[] = sprintf(_n('%d subscription could not be trashed - is it active or on-hold? Try cancelling it before trashing it.', '%s subscriptions could not be trashed - are they active or on-hold? Try cancelling them before trashing.', $error_count, WC_Subscriptions::$text_domain), $error_count);
} else {
$error_messages[] = sprintf(_n('%d subscription could not deleted - is it active or on-hold? Try cancelling it before deleting.', '%s subscriptions could not deleted - are they active or on-hold? Try cancelling them before deleting.', $error_count, WC_Subscriptions::$text_domain), $error_count);
}
}
}
}
}
}
$message_nonce = wp_create_nonce(__FILE__);
set_transient($this->message_transient_prefix . $message_nonce, array('messages' => $messages, 'error_messages' => $error_messages), 60 * 60);
// Filter by a given customer or product?
if (isset($_GET['_customer_user']) || isset($_GET['_product_id'])) {
if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'bulk-subscriptions')) {
wp_die(__('Action failed. Invalid Nonce.', WC_Subscriptions::$text_domain));
}
if (!empty($_GET['_customer_user'])) {
$user_id = intval($_GET['_customer_user']);
$user = get_user_by('id', absint($_GET['_customer_user']));
if (false === $user) {
wp_die(__('Action failed. Invalid user ID.', WC_Subscriptions::$text_domain));
}
$query_args['_customer_user'] = $user_id;
}
if (!empty($_GET['_product_id'])) {
$product_id = intval($_GET['_product_id']);
$product = get_product($product_id);
if (false === $product) {
wp_die(__('Action failed. Invalid product ID.', WC_Subscriptions::$text_domain));
}
$query_args['_product_id'] = $product_id;
}
}
$status = isset($_GET['status']) ? $_GET['status'] : 'all';
$query_args = array_merge($query_args, array('status' => $status, 'message' => $message_nonce));
$search_query = _admin_search_query();
if (!empty($search_query)) {
$query_args['s'] = $search_query;
}
$redirect_to = add_query_arg($query_args, admin_url('admin.php?page=subscriptions'));
// Redirect to avoid performning actions on a page refresh
wp_safe_redirect($redirect_to);
exit;
}
示例10: remove_query_arg
</h2>
<?php
if ( isset($_GET['deleted']) ) {
echo '<div id="message" class="updated fade"><p>';
$deleted = (int) $_GET['deleted'];
printf(__ngettext('%s link deleted.', '%s links deleted', $deleted), $deleted);
echo '</p></div>';
$_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
}
?>
<form class="search-form" action="" method="get">
<p class="search-box">
<label class="hidden" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label>
<input type="text" class="search-input" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" />
<input type="submit" value="<?php _e( 'Search Links' ); ?>" class="button" />
</p>
</form>
<br class="clear" />
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<div class="alignleft actions">
<select name="action">
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
示例11: pp_admin_projects
//.........这里部分代码省略.........
<div class="wrap nosubsub">
<?php
screen_icon();
?>
<h2>
<?php
echo wp_specialchars($title);
if (isset($_GET['s']) && $_GET['s']) {
printf('<span class="subtitle">' . __('Search results for “%s”', 'prologue-projects') . '</span>', wp_specialchars(stripslashes($_GET['s'])));
}
?>
</h2>
<?php
if (isset($_GET['message']) && ($msg = (int) $_GET['message'])) {
?>
<div id="message" class="updated fade"><p><?php
echo $messages[$msg];
?>
</p></div>
<?php
$_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
}
?>
<form class="search-form topmargin" action="" method="get">
<p class="search-box">
<label class="hidden" for="project-search-input"><?php
_e('Search Projects', 'prologue-projects');
?>
:</label>
<input type="text" class="search-input" id="project-search-input" name="s" value="<?php
_admin_search_query();
?>
" />
<input type="hidden" name="page" value="prologue-projects" />
<input type="submit" value="<?php
_e('Search Projects', 'prologue-projects');
?>
" class="button" />
</p>
</form><br class="clear" />
<div id="col-container">
<div id="col-right">
<div class="col-wrap">
<form id="posts-filter" action="" method="get">
<input type="hidden" name="page" value="prologue-projects" />
<div class="tablenav">
<?php
$pagenum = isset($_GET['pagenum']) ? absint($_GET['pagenum']) : 0;
if (empty($pagenum)) {
$pagenum = 1;
}
if (!isset($projectsperpage) || $projectsperpage < 0) {
$projectsperpage = 20;
}
$projectstotal = count(pp_get_projects());
$page_links = paginate_links(array('base' => add_query_arg('pagenum', '%#%'), 'format' => '', 'prev_text' => __('«', 'prologue-projects'), 'next_text' => __('»', 'prologue-projects'), 'total' => ceil($projectstotal / $projectsperpage), 'current' => $pagenum));
if ($page_links) {
?>
<div class="tablenav-pages"><?php
echo $page_links;
示例12: search_box
/**
* Display the search box.
*
* @since 3.1.0
* @access public
*
* @param string $text The search button text
* @param string $input_id The search input id
*/
public function search_box($text, $input_id)
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$input_id = $input_id . '-search-input';
if (!empty($_REQUEST['orderby'])) {
echo '<input type="hidden" name="orderby" value="' . esc_attr($_REQUEST['orderby']) . '" />';
}
if (!empty($_REQUEST['order'])) {
echo '<input type="hidden" name="order" value="' . esc_attr($_REQUEST['order']) . '" />';
}
if (!empty($_REQUEST['post_mime_type'])) {
echo '<input type="hidden" name="post_mime_type" value="' . esc_attr($_REQUEST['post_mime_type']) . '" />';
}
if (!empty($_REQUEST['detached'])) {
echo '<input type="hidden" name="detached" value="' . esc_attr($_REQUEST['detached']) . '" />';
}
echo '<p class="search-box">' . ' <label class="screen-reader-text" for="' . esc_attr($input_id) . '>' . $text . ':</label>' . ' <input type="search" id="' . $input_id . '" name="s" value="' . _admin_search_query() . '" />' . submit_button($text, 'button', false, false, array('id' => 'search-submit')) . '</p>';
}
示例13: search_box
public function search_box($text, $input_id)
{
?>
<p class="search-box">
<input type="search" id="<?php
echo $input_id;
?>
" name="s" value="<?php
_admin_search_query();
?>
">
<?php
submit_button($text, 'button', false, false, array('id' => 'search-submit'));
?>
</p>
<?php
}
示例14: baweic_list_codes
//.........这里部分代码省略.........
_e('Used', 'baweic');
?>
<span class="count">(<?php
echo $counts['used'];
?>
)</span></a> |</li>
<li class=""><a class="<?php
echo !empty($_GET['status']) && $_GET['status'] == 'not_used' ? 'current' : '';
?>
" href="<?php
echo admin_url('admin.php?page=baweic_list_codes&status=not_used');
?>
"><?php
_e('Not used', 'baweic');
?>
<span class="count">(<?php
echo $counts['not_used'];
?>
)</span></a></li>
</ul>
<form action="<?php
echo admin_url('admin.php');
?>
">
<p class="search-box">
<label class="screen-reader-text" for="<?php
echo $input_id;
?>
"><?php
_e('Search by keyword');
?>
:</label>
<input type="search" id="search-text" name="s" value="<?php
_admin_search_query();
?>
" />
<input type="hidden" id="page" name="page" value="baweic_list_codes" />
<?php
submit_button(__('Search codes', 'baweic'), 'button', false, false, array('id' => 'search-submit'));
?>
</p>
</form>
<table id="codes_table" class="widefat plugins datatables">
<thead>
<tr>
<th scope="col" width="350"><?php
_e('Code', 'baweic');
?>
</th>
<th scope="col" width="350"><?php
_e('Counter', 'baweic');
?>
</th>
<th scope="col" width="350"><?php
_e('User(s)', 'baweic');
?>
</th>
<th scope="col"><?php
_e('Action', 'baweic');
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col"><?php
示例15: search_box
/**
* Display the search box.
*
* @since 2.0.18
* @access public
*
* @param string $text The search button text
* @param string $input_id The search input id
*/
public function search_box($text, $input_id)
{
if (empty($_REQUEST['s']) && !$this->has_items()) {
return;
}
$input_id = $input_id . '-search-input';
foreach (array('orderby', 'order') as $search_params) {
$this->hidden_search_inputs($search_params);
}
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php
echo esc_attr($input_id);
?>
"><?php
echo wp_kses($text, array());
?>
:</label>
<input type="search" id="<?php
echo esc_attr($input_id);
?>
" name="s" value="<?php
_admin_search_query();
?>
" />
<?php
submit_button($text, 'button', '', false, array('id' => 'search-submit'));
?>
</p>
<?php
}