Using WordPress User Details outside Directory

I have a PHP Web App in which I want to use some User Details from WordPress installed inside a Folder.
Suppose My App will be inside ===>>> www.example.com
and my WordPress install will be inside ===>>> www.example.com/membership.
Basically I will check if User is Logged-In in WordPress and use some values
from WordPress Database to restrict Few Settings in my Web App.
I anyways need WordPress for Blogging purpose so thinking of using its User
Registration and
Log-In module as well.
Possible ?

Related posts

1 comment

  1. Yes this is possible. You can utilize wp in your app in following way:

    <?php 
    define('WP_USE_THEMES', false);
    require(__DIR__'/membership/wp-blog-header.php');
    if ( is_user_logged_in() ) {
        $current_user = wp_get_current_user();
    }
    ?>
    

Comments are closed.