WC_Admin_List_Table_Products::search_label
Change the label when searching products
Method of the class: WC_Admin_List_Table_Products{}
No Hooks.
Returns
String.
Usage
$WC_Admin_List_Table_Products = new WC_Admin_List_Table_Products(); $WC_Admin_List_Table_Products->search_label( $query );
- $query(string) (required)
- Search Query.
WC_Admin_List_Table_Products::search_label() WC Admin List Table Products::search label code WC 10.3.3
public function search_label( $query ) {
global $pagenow, $typenow;
if ( 'edit.php' !== $pagenow || 'product' !== $typenow || ! get_query_var( 'product_search' ) || ! isset( $_GET['s'] ) ) { // WPCS: input var ok.
return $query;
}
return wc_clean( wp_unslash( $_GET['s'] ) ); // WPCS: input var ok, sanitization ok.
}