I have a javascript app running in a Wordpress page as an iframe. I want to take the WP member username into my app, and use it to call a php file which returns a directory listing from that user's folder (/[username]/) as a javascript array inside my app. I have successfully used a glob command to retrieve known directory listings, but I need a dynamic way to get any user's content into my application. Please help.
To use wordpress user data outside wordpress or in iFrame you have to include wp-load.php
file in order to load the wordpress core functions anywhere in current project.
wp-load.php
is one way to load WP from external scripts, allowing the use of WP functions among other features.