File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -858,15 +858,14 @@ The Wordpress authentication middleware defines three routes:
858858
859859A user can be logged in by sending it's username and password to the login endpoint (in JSON format).
860860The user can be logged out by sending a POST request with an empty body to the logout endpoint.
861- In the authorization middleware  you can  use functions:
861+ The middleware calls "wp-load.php" this allows  you to  use Wordpress  functions in the authorization middleware, like :
862862
863863-  wp_get_current_user()
864864-  is_user_logged_in()
865865-  is_super_admin()
866866-  user_can(wp_get_current_user(),'edit_posts');
867867
868- Play with it and let me know how you like it.. :-)
869- 
868+ Note that the ` $_SESSION `  variable is not used by this middleware.
870869
871870#### Basic authentication  
872871
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments