meta_filter and sort
I am having trouble with a meta_filter in my groups-loop. Here is a gist with the filter function and its hook registration.
It works as expected, except I would like the results to be sortable via the default order options as well as custom ones, but currently the sorting action resets my meta query.
The sorting I mean is via this thingy:
<label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> <select id="groups-order-by"> <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option> <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option> <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> <?php do_action( 'bp_groups_directory_order_options' ); ?> </select>
The event handler for the above select is being added to the select object by some js, and I am not sure if that is due to buddypress or the parent theme (CBOX-theme) that I am using, but in any case it is sending an AJAX request to buddypress. As stated, these requests clear my meta_query.
I am currently using a simple GET form action to apply my filters, so I am guessing what I need to do is to loop my filters in as an AJAX request instead. Will that fix my issue?
- You must be logged in to reply to this topic.