WC_Admin_API_Keys_Table_List::search_box()publicWC 1.0

Search box.

Метод класса: WC_Admin_API_Keys_Table_List{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Admin_API_Keys_Table_List = new WC_Admin_API_Keys_Table_List();
$WC_Admin_API_Keys_Table_List->search_box( $text, $input_id );
$text(строка) (обязательный)
Button text.
$input_id(строка) (обязательный)
Input ID.

Код WC_Admin_API_Keys_Table_List::search_box() WC 8.7.0

public function search_box( $text, $input_id ) {
	if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { // WPCS: input var okay, CSRF ok.
		return;
	}

	$input_id     = $input_id . '-search-input';
	$search_query = isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : ''; // WPCS: input var okay, CSRF ok.

	echo '<p class="search-box">';
	echo '<label class="screen-reader-text" for="' . esc_attr( $input_id ) . '">' . esc_html( $text ) . ':</label>';
	echo '<input type="search" id="' . esc_attr( $input_id ) . '" name="s" value="' . esc_attr( $search_query ) . '" />';
	submit_button(
		$text,
		'',
		'',
		false,
		array(
			'id' => 'search-submit',
		)
	);
	echo '</p>';
}