Skip to content

Instantly share code, notes, and snippets.

@shubham-99fusion
Last active November 26, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubham-99fusion/4bb706f8e954df0b9b200294f4c8ba08 to your computer and use it in GitHub Desktop.
Save shubham-99fusion/4bb706f8e954df0b9b200294f4c8ba08 to your computer and use it in GitHub Desktop.
add_filter('bp_course_api_get_course_terms','remove_blank_cats',10,2);
function remove_blank_cats($categories, $request){
foreach($categories as $category) {
if($category->count >0) { $newcategories[]=$category; }
} return $newcategories;
}
add_filter('bp_course_rest_prepare_course',function($response, $course, $request){
$short_desc = get_the_excerpt($response->data['course']['id']);
$response->data['description'] = $short_desc.'<br/>'.$response->data['description'];
return $response;
},10,3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment