I doubt any third party plugin using get_current_user_id() would work .
Even we had to change our addons code as well to make them work with wplms V4 version .
I already told you how to do it even shared the code how to do it, with your code.
AS this is part of custom job we can only guide about the theme details and code .Making it work is your developer or your part .
I have checked the code provided previously , here is the tried and tested code which is working :
add_filter( 'bp_course_api_get_user_course_status_item',function($return, $request ){
$body = json_decode($request->get_body(),true);
if(!empty($body['token']) && is_numeric($request['course'])){
$user = apply_filters('vibebp_api_get_user_from_token','',$body['token']);
$user_id = $user->id;
}
if(!empty($user_id)){
//do your thing here and add the content to :
ob_start();
echo 'your dynamic content';
$cont = ob_get_clean();
$return['content'] .= $cont;//here the content is appending in api call return
}
return $return;
},10,2);
Well yes you can remove that now in wp-admin -> wplms -> footer -> google anaylitics script as that tip is useless.
The topic ‘query in the course of the database’ is closed to new replies.