4 Replies
Andrew Lian

Hi Sam and thanks for the information/question.

I am looking for a way to get the information from wp_get_current_user into a JS variable that I can then process to personalize my Articulate lesson (e.g. show full name - or even user id or whatever). I know how to do that in PHP but articulate requires JS.


Sam Hill

Hi Andrew, yes you would need to have some understanding of WordPress in order to make this possible. There is a method for making JavaScript variables available to applications via the functions.php file of your project.

Maybe Learndash provides this information through an API though? It might be worth first contacting LearnDash and asking "Do you provide a JavaScript API to get any user information such as ID". If they do, then the method to access this and load into your course will be relatively simple.

The WordPress method is a bit more involved, and you'd definitely need somebody who is comfortable working with the functions.php file in WordPress in order to get that data for you.