WC_Admin_Log_Table_List::source_dropdown
Display source dropdown
Method of the class: WC_Admin_Log_Table_List{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->source_dropdown();
Notes
- Global. wpdb.
$wpdb
WC_Admin_Log_Table_List::source_dropdown() WC Admin Log Table List::source dropdown code WC 10.6.2
<?php
protected function source_dropdown() {
$sources = $this->get_sources();
if ( ! empty( $sources ) ) {
$selected_source = isset( $_REQUEST['source'] ) ? $_REQUEST['source'] : '';
?>
<label for="filter-by-source" class="screen-reader-text"><?php esc_html_e( 'Filter by source', 'woocommerce' ); ?></label>
<select name="source" id="filter-by-source">
<option<?php selected( $selected_source, '' ); ?> value=""><?php esc_html_e( 'All sources', 'woocommerce' ); ?></option>
<?php
foreach ( $sources as $s ) {
printf(
'<option%1$s value="%2$s">%3$s</option>',
selected( $selected_source, $s, false ),
esc_attr( $s ),
esc_html( $s )
);
}
?>
</select>
<?php
}
}