You can access to any WordPress functions if you first include the wp-load.php
to your custom PHP page.
<?php
require_once('path/to/wp-load.php');
if( ! is_user_logged_in() ) {
auth_redirect();
}
// Your application starts from here...
?>
Related Posts:
- Display message once per session to users with a specific role
- How to store post ID’s in cookie or session to display the same posts later
- iframe does not store session/cookie when refresh parent
- $_SESSION variable not saving on page refresh or new page
- Set cookie parameters on wp site – PHP not working?
- Allow user to select location and then set cookie for location in WordPress
- How to ‘remember’ a site member’s last visited page?
- Cookies vs. sessions
- Setting custom cookies in WordPress
- Add extra field to users
- Display user’s total comment count outside The Loop
- How to log out everywhere else, destroy all sessions “all other devices”?
- Changing user_nicename
- What is the most efficient way to search users by their display name?
- Can i check if user is doing any ajax request?
- How do I create a WP user outside of WordPress and auto login?
- Network installation giving errors when viewing or adding a user
- How do I hide specific user profile fields?
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- how to create and show sessions in word press?
- Using a nonce in a Custom Login Form
- Should I store my Facebook access tokens?
- automated tests as a user?
- Site Health : An active PHP session was detected
- integrating external php library into wordpress- the right way
- get_users(…) only returns one user
- List User order by ID in Descending order (Backend)
- Warning: Use of undefined constant HTTP_USER_AGENT – assumed ‘HTTP_USER_AGENT’ (this will throw an Error in a future version of PHP)
- Get all user meta by meta key instead of ID
- Fatal Error relating to sessions.php
- User management system similar to wordpress one?
- Show all posts by author
- Custom user login page by creating a plugin
- Programmatic Login from 3rd Party site
- Get users that likes the post
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- add_cap not working
- wordpress archive a user
- Call to undefined function get_userdata() in plugin
- Insert custom PHP head above in WP pages
- Having Issue on Redirecting With Session in WordPress
- My php code is not being executed
- How do you create two separate Register pages?
- $_SESSION variables work perfectly on my local machine but returns NULL on development webserver
- Change page password every day (predictable password ;) )
- show something only when user comes from specific page at remote host?
- Get the users that my following users are following
- The session works on the local server, but not on the web server
- create front-end users post list by specific category
- How to set cookies
- Can we stop session reset if page reloads?
- ‘pre_user_query’ interfering with user export
- How to make a cookie be on the whole site instead of being on a specific page/
- Authentication from sub-folder non-wp cookie WordPress
- How can I call a specific file (via php) by referencing the logged-in username?
- Uses for function: wp_update_user
- Display additional user fields
- Deleting expired session tokens in WordPress
- PHP: $_SESSION destroyed after page reload for my custom session
- Sort new column in Users wp-admin
- Are there any drawbacks on opening a session_start in functions.php and header.php?
- Allow a user or role to view drafts and previews, but not other admin privileges?
- Storing huge number of users in wordpress
- Get current user id in function php
- How to count active users on a specific page
- Hide Approved status for certain users in users list
- Uploading/integrating custom user registration page
- Export WordPress User Meta to CSV/Excel
- Page template not working when logged out
- Allow specific user to edit a specific page
- Display current user metadata on WordPress page
- Help hooking into user_register
- is_user_logged_in() not working in homepage
- WordPress load javascript file if something… (after the page is loaded)
- Serve cookie free URLs in WordPress without using a CDN
- (Who to follow) Twitter widget
- Can’t get_users info by using json_encode
- Matching multi user
- Update only some custom user fields
- List users in a dropdown for login
- How to set max users to 17.000
- Trying to display user meta by “name” – not by “ID”
- main menu page redirects to user ID
- White screen after login attempt
- Adapting a php array to WordPress
- Where are Sessions are being started? [closed]
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- Cookie not created in AJAX request
- Forbid certain users to access a specific page
- One folder to be accessible by one user
- Why can’t I enter the wordpress admin interface?
- Losing Session ID and sessionStorage when navigating to other domains on Multisite
- How to transfer session after being redirected to other page
- Keep users logged in Without Remember Me
- How to lock users account until approvation
- How to create a User Role and give permission to only use Web Stories plugin?
- How to create custom user role without plugin?
- PHP Works only for logged in users: [closed]
- Custom Admin Menu Report for Specific User ID
- How to add custom user role into wordpress