Tell us what you are trying to do?
I don't want my wpv_filter_query to stop working when the AJAX results are triggered.
Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
Is there a similar example that we can see?
This works on load but not when AJAX filters are fired.
if ( $view_id == 690 ) {
if ( !is_admin() ) {
$query_args['author'] = empty( $current_user->ID ) ? -1 : '-'.$current_user->ID;
if ( !empty($raw_ids) ) {
$query_args['post__not_in'] = $ids;
}
}
}
What is the link to your site?
hidden link
Hi,
Thank you for contacting us and I'd be happy to assist.
The custom function attached to the "wpv_filter_query" filter should be executed, when the results are updated through AJAX.
Can you please share temporary admin login details along with the complete function code that you're using with the "wpv_filter_query" filter?
This will help in troubleshooting this on a test website with a similar setup.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Thank you for sharing these details.
I've performed some tests on my website with a similar view and custom function and noticed that the "!is_admin()" check needs to be removed, in order to make the filtering work, when the results are updated through AJAX.
From your function "prefix_no_show_only_current_author", you'll only need to remove the "!is_admin()" check.
My issue is resolved now. Thank you for your help with this!