wordpress - how set the scope for the AJAX query with buddy press meta query -


i trying filter group meta query reference of bellow reference link code

https://gist.github.com/boonebgorges/2638943

this link code have added in function.php

and bellow code of spinet have added in /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php in div groups dir-list

$meta_filter = new bp_groups_meta_filter( 'group-custom-field-cat', 'art , culture' ); //print_r($meta_filter);                echo @json_decode($meta_filter, true);  

now if visit group page code filtering group have meta key=group-custom-field-cat , value=art , culture.this workaround working.

on same page have add 1 select box option art , culture

if user select option call ajax query , run bellow code filter group if have meta key , value bellow.so how call ajax.

    <?php   if ($groupname=="art , culture"){   $meta_filter = new bp_groups_meta_filter( 'group-custom-field-cat', 'art , culture' );                     echo @json_decode($meta_filter, true);     }    ?>   

working example:-http://tamrielfoundry.com/groups/

can know how call ajax query fit need.


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -