WC_Admin_List_Table_Products::define_sortable_columnspublicWC 1.0

Define which columns are sortable.

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->define_sortable_columns( $columns );
$columns(array) (required)
Existing columns.

WC_Admin_List_Table_Products::define_sortable_columns() code WC 11.0.1

public function define_sortable_columns( $columns ) {
	$custom = array(
		'price'            => 'price',
		'sku'              => 'sku',
		'name'             => 'title',
		'global_unique_id' => 'global_unique_id',
	);

	if ( $this->use_cogs_lookup_column ) {
		$custom['cogs_value'] = 'cogs_value';
	}

	return wp_parse_args( $custom, $columns );
}