It might not be very light solution but it might be much more straightforward approach to load WP core and use current_user_can()
and related stuff for determining user permissions.
Related Posts:
- Is it best to avoid using $wpdb for security issues?
- How can I prevent SQL injection in PHP?
- esc_attr() right way and use
- Enforcing password complexity
- Transaction when using WP functions rather than vanilla SQL?
- $wpdb->get_results(…) returns empty array despite correct query
- Does My Child-Theme Functions.php Need if{die} Security In It? [duplicate]
- How to get the list of WooCommerce product image of a certain category from database?
- How Attackers write script into my php files?
- How to make WordPress plugin check for database changes and then do something?
- Alter query on edit.php
- How to auto login user again after change user_login
- How to display multiple Post meta_key/meta_values by SQL query
- Renaming wp-content folder dynamically
- How do I create a WP user outside of WordPress and auto login?
- How to Join two tables from separate databases within WordPress
- count number of user comments with a specific comment meta value
- Security – Ajax and Nonce use [closed]
- Can I write ‘RewriteCond’ using ‘functions.php’?
- Is it unsafe to put php in the /wp-content/uploads directory?
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- WPDB: how to get the value of a field in a custom database table
- Database “Migration” for Plugins?
- my function doesn’t return my post from today
- Sanitize get_query_var() url parameters
- Enhanced WordPress Search
- Automatically generate Post/Page from searched Database item?
- List of posts by day of the week
- register_activation_hook isn’t adding table to DB
- Databases – Submitting data from inputs to database [closed]
- Security: blocking direct access of php files
- Correct and safe way to include php content in my page
- Password minimum length in personal subscription [closed]
- How to add API security keys into JS of wordpress securely
- Hardening uploads folder in IIS breaks images
- Troll the hackers by redirecting them
- Security updates to 3.3.2
- dynamic page using php from sql database
- how to prevent wordpress admin from logging in via woocommerce my-account page
- Use $wpdb or other PHP script method to find/replace in WP database
- How to Update post_modified of all wordpress post
- malware undetectable by multiple scans
- Correct PHP to output a single result of a Function with SQL Query
- How can I add a new row in a separate database when someone registers via WordPress?
- Decoded malware code [closed]
- PHP -> SQL Query with Summing
- Lost in trying to create user database system
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Filter results from a serialized string to use on statistics
- wordpress site – using custom database and PHP
- Searching Posts Programmatically in a WordPress Plugin
- Use variable in SQL statement
- Why my query does not run with prepare
- Updating From Mobile App – Exposing Site to Hacking
- wpdb getting avatars and author url
- mySQL queries are executed twice on wordpress website
- making php value numeric
- Using color schemes with Color Picker
- WordPress SQL JOIN query
- Fetching review value using wpdb class
- Remove password protection from all posts
- quotes problem in very simple sql
- wordpress sql posts query won’t display the latest post in a specific category
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- security concerns if using html data-* attribute for l10n?
- WP_Query: How to get results from both meta_key options?
- How to correctly escape an echo
- get_terms with specific id order
- Reject all malicious URL requests functions.php
- Database SQL query error
- portfolio site – about this site section – is it safe to post some code
- get different meta-data of a complicated query at the same time
- WordPress SQL Prepare
- Build A Custom SQL Query for WordPress Search
- How to run complex query using PHP
- Storing huge number of users in wordpress
- add role on WordPress in PHP on a second database
- echo cutom css code to WordPress page template file ? is this safe?
- Trying to create a shortcode to display categories with a specific product tag
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Creating multiple tables with Plugin
- Custom User registration system
- How to use Multi SQL Database in WordPress?
- How to secure my php forms
- Woocommerce – get daily sales meta
- $.ajax results in 403 forbidden
- Site infected by link
- Running a PHP SQL script on a wordpress page
- Collect all events in one year
- WordPress search query, how to modify the sql
- Access WP files on “server 1”, from “server 2” – using wp-load on an external website
- How do I get data from my database into my Custom Export Field
- Deny php execution in /wp-includes – using .htaccess in /wp-includes VS root folder
- Inserting other fields to existing registration form in a WordPress theme
- Getting error in sql query
- user update profile for custom code
- Where to check in PHPmyAdmin / SQL database for subdomain
- Front end/Database connection in WP
- Plugin Modification Change Functionality For Logged User Only