Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chrisjohnson13

    (@chrisjohnson13)

    Can anyone help, please.

    Thanks

    function epl_remove_location_sort($sorters) {
    
    	foreach($sorters as $key	=>	 &sorter) {
    		if( in_array($sorter['id'], array('location_asc','location_desc') ) ) {
    			unset($sorters[$key]);
    		} 
    
    	}
    
    	return $sorters;
    }
    add_filter('epl_sorting_options','epl_remove_location_sort');

    PLease try this

    Thanks

    Plugin Author Merv Barrett

    (@mervb1)

    Noticed an error in the PHP with the &sorter should be $sorter. Here is an update of the function

    function epl_remove_location_sort($sorters) {
    
    	foreach($sorters as $key	=>	 $sorter) {
    		if( in_array($sorter['id'], array('location_asc','location_desc') ) ) {
    			unset($sorters[$key]);
    		}
    	}
    	return $sorters;
    }
    add_filter('epl_sorting_options','epl_remove_location_sort');
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sort drop down Suburb A-Z’ is closed to new replies.