本文整理汇总了PHP中WP_List_Table::search_box方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_List_Table::search_box方法的具体用法?PHP WP_List_Table::search_box怎么用?PHP WP_List_Table::search_box使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_List_Table
的用法示例。
在下文中一共展示了WP_List_Table::search_box方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search_box
public function search_box($text, $input_id)
{
if (!$this->search_box) {
return '';
}
parent::search_box($text, $input_id);
}
示例2: render
/**
* Render the view.
*/
public function render()
{
?>
<form method="GET">
<input type="hidden" name="page" value="<?php
echo esc_attr($_GET['page']);
?>
">
<?php
if (isset($_GET['status'])) {
?>
<input type="hidden" name="status" value="<?php
echo esc_attr($_GET['status']);
?>
">
<?php
}
?>
<?php
$this->table->views();
?>
<?php
$this->table->search_box(__("Search", Plugin::SLUG), 'itelic-search');
?>
<?php
$this->table->display();
?>
</form>
<?php
}
示例3: search_box
/**
* Displays the search box if it was enabled in table arguments.
*
* @since 4.0.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 (isset($this->_args['search_box']) && $this->_args['search_box']) {
parent::search_box($text, $input_id);
}
}
示例4: search_box
/**
* Display search box.
*
* @since 141111 First documented version.
*
* @param string $text The search button `value=""`.
* This will default to a value of `Search`.
* @param string $input_id The search input `id=""` attribute.
* This parameter is always forced to an id-compatible value.
* This will default to a value of `get_class($this).'::'.__FUNCTION__`.
*
* @throws \exception If unable to do `name="search-submit"` replacement.
*/
public function search_box($text = '', $input_id = '')
{
// @codingStandardsIgnoreEnd
if (!$this->getFtSearchableColumns() && !$this->getSearchableColumns() && !$this->getNavigableFilters()) {
return;
// Not applicable.
}
$text = (string) $text;
$input_id = (string) $input_id;
$text = !$text ? __('Search', 'comment-mail') : esc_html($text);
$input_id = !$input_id ? get_class($this) . '::' . __FUNCTION__ : $input_id;
$input_id = trim(preg_replace('/[^a-z0-9\\-]/i', '-', $input_id), '-');
ob_start();
// Open an output buffer.
parent::search_box($text, $input_id);
$search_box = ob_get_clean();
$regex = '/\\b(?:name\\s*\\=\\s*(["\']).*?\\1\\s+)?id\\s*\\=\\s*(["\'])search\\-submit\\2/i';
if ($search_box) {
// Only if there is a search box; it doesn't always display.
if (!($search_box = preg_replace($regex, 'name="search-submit" id="search-submit"', $search_box, 1, $replacements)) || !$replacements) {
throw new \exception(__('Unable to set `name="search-submit"` attribute.', 'comment-mail'));
}
}
echo $search_box;
// Display.
}
示例5: search_box
/**
* Display the search box.
*
* @param string $text The search button text
* @param string $input_id The search input id
*/
public function search_box($text, $input_id)
{
if ($this->get_current_view() != 'related') {
parent::search_box($text, $input_id);
}
}
示例6: search_box
public function search_box($text, $input_id)
{
return parent::search_box($text, $input_id);
// TODO: Change the autogenerated stub
}
示例7:
function search_box($text, $input_id)
{
$this->search_box_called = true;
parent::search_box($text, $input_id);
$this->search_box_called = false;
}
示例8:
/**
* Display Search box
*
* @since 1.4
* @returns html Search Form
*/
function search_box($text, $input_id)
{
parent::search_box($text, $input_id);
}