Filter: tcp get sorting fields

Description

It allows to add or change completely the list of sorting fields in TheCartPress.

Parameters

$sorting_fields
(Array) List of sorting fields with the next format: array( array( ‘value’, ‘title’), …).

Value

Identifier of the sorting fields

Title

Label of the sorting fields. This value is displayed in the selection lists.

Example

Deleting more fields

<?php
function my_tcp_get_sorting_fields( $sorting_fields ) {
	unset( $sorting_fields['author'] );
	unset( $sorting_fields['date'] );
	return $sorting_fields;
}
add_filter( 'tcp_get_sorting_fields', 'my_tcp_get_sorting_fields' ); ?>

Change Log

Since 1.0.8

Related

tcp_the_sort_panel | tcp_get_sorting_fields