WC_Admin_List_Table_Products::remove_ordering_argspublicWC 1.0

Remove ordering queries.

Method of the class: WC_Admin_List_Table_Products{}

No Hooks.

Returns

Array.

Usage

$WC_Admin_List_Table_Products = new WC_Admin_List_Table_Products();
$WC_Admin_List_Table_Products->remove_ordering_args( $posts );
$posts(array)
Posts array, keeping this for backwards compatibility defaulting to empty array.
Default: array()

WC_Admin_List_Table_Products::remove_ordering_args() code WC 10.3.6

public function remove_ordering_args( $posts = array() ) {
	remove_filter( 'posts_clauses', array( $this, 'order_by_price_asc_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'order_by_price_desc_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'order_by_sku_asc_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'order_by_sku_desc_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'filter_downloadable_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'filter_virtual_post_clauses' ) );
	remove_filter( 'posts_clauses', array( $this, 'filter_stock_status_post_clauses' ) );
	if ( $this->use_cogs_lookup_column ) {
		remove_filter( 'posts_clauses', array( $this, 'order_by_cogs_value_asc_post_clauses' ) );
		remove_filter( 'posts_clauses', array( $this, 'order_by_cogs_value_desc_post_clauses' ) );
	}
	return $posts; // Keeping this here for backward compatibility.
}