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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -