The easiest way is to use if ( current_user_can( 'capability' ) ) // do stuff
. You’ll find more about capabilities in the codex. You can also inspect the data some user has attached with normal var_dump()
and else. I also got a pretty old plugin for that. But I’m not sure if it still works with the current WP version. If it does, you’ll be presented with close to all user data and some hints & snippets on a new admin page.
Related Posts:
- Getting a List of Currently Available Roles on a WordPress Site?
- How to secure or disable the RSS feeds?
- How do I authenticate WP users from a chrome extension?
- Best Way to Enable Two Step Authentication
- Single sign-on: wp_authenticate_user vs wp_authenticate
- How does the “authentication unique keys and salts” feature work?
- Auth cookie value security risk?
- Dangers to allowing Access-Control-Allow-Origin: * for Feeds only?
- Restrict Access in Admin Panel
- Auto log in hook is requiring a page refresh
- Is WordPress secure enough for a multi-user article directory?
- User generated content and security
- Uploading attachment (pdf) and prevent download for anonymous user
- How to make WP page accessile only to specific user roles
- Custom user roles are unable to login
- Why is SSH password authentication a security risk?
- SSL Error: unable to get local issuer certificate
- When you use ‘badidea’ or ‘thisisunsafe’ to bypass a Chrome certificate/HSTS error, does it only apply for the current site? [closed]
- Why does the URL http://a/%%30%30 crash Google Chrome?
- When you use ‘badidea’ or ‘thisisunsafe’ to bypass a Chrome certificate/HSTS error, does it only apply for the current site?
- Can an attacker use inspect element harmfully?
- Where does Internet Explorer store saved passwords?
- WordPress 4.7.1 REST API still exposing users
- Should I escape wordpress functions like the_title, the_excerpt, the_content
- When to use esc_html and when to use sanitize_text_field?
- Will there be security updates for 3.1 once 3.2 is released?
- wp_update_user not updating
- WordPress it’s cleaning a custom query_var to avoid sql injections?
- How can I hide a category from Contributors in the edit/add new post screen?
- Tips for finding SPAM links injected into the_content
- Is WordPress vulnerable to the httpoxy?
- Prevent setup-config.php page from appearing when host blocks database
- Restrict users on multisite WordPress install
- Basic auth WordPress REST API dilemma
- wp.getUsersBlogs XMLRPC Brute Force Attack/Vulnerability
- Is there a security risk giving someone temporary access to my blog’s code?
- How to properly sanitize/secure a WP Query coming from the front end
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- What is the difference between “create_users” and “add_users” capabilities?
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Should I Worry About SQL Injection When Using wp_insert_post?
- Security – Shortcode injection attack
- Registration Plugin – Recaptcha integration
- How to combat flooding admin-ajax.php?
- How to disable a specific page for a specific user
- Moving away from MD5: Where to declare the custom global $wp_hasher?
- Would it be dangerous to send all the wp_options to javascript file?
- Should I disable directory listing for wp-includes?
- Authentication with the Rest API when using an External Application
- Safety side of storing emoji into database
- How can I safely hide the fact that my website runs on WordPress? [closed]
- How can I display nickname instead username in links
- My WordPress Websites are always under attack
- Is there value in using a wp_nonce for POST requests?
- Create custom post with custom user rules
- How to hide easy access to my website temporarily?
- Can I Remove xmlrpc.php completely?
- How much should I worry about these messages?
- Plugin creation – how to add user rights?
- Uploading .webm format on WordPress results in security guidline breach and fail
- Any any insecure http:// URLs left in wordpress?
- White screen of death on admin pages after moving wp-config up two levels for security
- User restricted only show posts assigned to current user
- remove wp admin menu by customer user role
- Can a WordPress administrator see other users’ passwords?
- Why my plugins are updating automatically?
- Spam injected in w3 total cache page cache [closed]
- Privilege escalation bugs in 2.9?
- How do you manage your pages or functions that require logged-in users?
- Content-Security-Policy blocks WordPress check boxes from being activated
- Allow admins to login as other users
- Prevent editor from adding script or form
- wordpress admin security
- Remove hacked code – out of ideas! [closed]
- Why do people use “admin” username by default? [closed]
- Give users acces to admin a single post or set up WP network?
- if role is logged in then do something
- prevent anonymous access to WordPress site (non-admin site)
- WordPress Database Re-installed (Hacked)
- WordPress Security tools
- Robots.txt file not updating
- Security: Critical backend outside of wordpress
- Advice On How to Backup WordPress
- How can I stop other plugins from using my class’ sensitive methods?
- What are WordPress Current Security Issues in 2017?
- wp-config.php moved above root results in no plugin updates
- Allowing users to edit only their page and nobody else’s
- Users are required to login to my site. How define user.member boolean, its permissions, and conditionally display/handle behavior based on it
- How to bulk change user role to “No role for this site”
- Password-protect feed and make it usable in major aggregators
- Is it possible to restrict a specific user to edit a specific custom post.
- Securely log in a user without a password using a link?
- how to find the way they hacked my WP site
- is this code properly secured
- nginx + wordpress: Best practices for configuring it to be secure, reliable, and fast? [closed]
- How to get real password (before encrypt) when register a user?
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- How do you search for backdoors from the previous IT person?
- Is wp-cron.php vulnerable to external attacks and how to protect it?
- How to address security vulnerabilities: LUCKY13, BEAST, and BREACH