Created
June 23, 2020 06:36
-
-
Save MrVibe/0c3067e68a952e41792043ebe619dba8 to your computer and use it in GitHub Desktop.
Load courses only from a cateogry XX in the mobile app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('rest_api_init',function(){ | |
add_filter('bp_course_wplms_filters',function($args){ | |
if(empty($args['tax_query'])){ | |
$args['tax_query']=array( | |
'relation' => 'AND', | |
array( | |
'taxonomy'=>'course-cat', | |
'field'=>'id', | |
'terms' =>array('xx','xx') | |
) | |
); | |
}else{ | |
$args['tax_query'][]=array( | |
'taxonomy'=>'course-cat', | |
'field'=>'id', | |
'terms' =>array('xx','xx') | |
); | |
} | |
return $args; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment