Skip Navigation

[Escalated to 2nd Tier] Sorting by Last Modified not being respected on Front End

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 19 replies, has 2 voices.

Last updated by Minesh 2 months ago.

Assigned support staff: Minesh.

Author
Posts
#1715789

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - if you want to drop the AJAX then you need to add the Search Button to your "Search and Pagination" Section to that should help to submit/trigger the sorting. Once you add the search button let me know and I will see if there is any requirement to adjust the code after adding search button.

#1715793

HI Minesh

We already have 2 Search and Reset buttons in the Search and Pagination section. One set to appear at the top of the filter critieria and another at the bottom. We know that the user has to manually click the Search button to refresh the results currently.

Kind regards
Simon

#1715795

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ahh - I totally missed that.

I've adjusted the code as given under in the case of not using AJAX:

function func_set_default_orderby_modified( $view_args, $view_settings, $view_id ) {
	$target_view_ids = array(2145,2231);
		if( in_array($view_id, $target_view_ids ) and !isset($_GET['wpv_filter_submit']) ) {
			$view_args['orderby'] = 'post_modified';
		}
	return $view_args;
}
add_filter( 'wpv_filter_query', 'func_set_default_orderby_modified', 101, 3 );

Can you confirm it works as expected.

#1717133

HI Minesh

I tested. It seems to be working. Thank you. Please set status back to Escalated to 2nd tier.

Kind regards
Simon

#1718975

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - great.

I will get in touch with you as soon as the official fix will be released.