You appear to be a bot. Output may be restricted
Description
Change views on the edit product screen.
Usage
$array = WC_Admin_List_Table_Products::product_views( $views );
Parameters
- $views
- ( array ) required – Array of views.
Returns
array
Source
File name: woocommerce/includes/admin/list-tables/class-wc-admin-list-table-products.php
Lines:
1 to 18 of 18
public function product_views( $views ) { global $wp_query; // Products do not have authors. unset( $views['mine'] ); // Add sorting link. if ( current_user_can( 'edit_others_products' ) ) { $class = ( isset( $wp_query->query['orderby'] ) && 'menu_order title' === $wp_query->query['orderby'] ) ? 'current' : ''; $query_string = remove_query_arg( array( 'orderby', 'order' ) ); $query_string = add_query_arg( 'orderby', rawurlencode( 'menu_order title' ), $query_string ); $query_string = add_query_arg( 'order', rawurlencode( 'ASC' ), $query_string ); $views['byorder'] = '<a href="' . esc_url( $query_string ) . '" class="' . esc_attr( $class ) . '">' . __( 'Sorting', 'woocommerce' ) . '</a>'; } return $views; }