ActionScheduler_Abstract_ListTable::extra_tablenav
Display the table.
Метод класса: ActionScheduler_Abstract_ListTable{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ActionScheduler_Abstract_ListTable = new ActionScheduler_Abstract_ListTable(); $ActionScheduler_Abstract_ListTable->extra_tablenav( $which );
- $which(строка) (обязательный)
- The name of the table.
Код ActionScheduler_Abstract_ListTable::extra_tablenav() ActionScheduler Abstract ListTable::extra tablenav WC 10.5.2
public function extra_tablenav( $which ) {
if ( ! $this->filter_by || 'top' !== $which ) {
return;
}
echo '<div class="alignleft actions">';
foreach ( $this->filter_by as $id => $options ) {
$default = ! empty( $_GET['filter_by'][ $id ] ) ? sanitize_text_field( wp_unslash( $_GET['filter_by'][ $id ] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( empty( $options[ $default ] ) ) {
$default = '';
}
echo '<select name="filter_by[' . esc_attr( $id ) . ']" class="first" id="filter-by-' . esc_attr( $id ) . '">';
foreach ( $options as $value => $label ) {
echo '<option value="' . esc_attr( $value ) . '" ' . esc_html( $value === $default ? 'selected' : '' ) . '>'
. esc_html( $label )
. '</option>';
}
echo '</select>';
}
submit_button( esc_html__( 'Filter', 'woocommerce' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
echo '</div>';
}