Unless performance is a huge factor, or you need to change PHP session globals, you don’t need to run anything before wordpress, just write a plugin that makes the checks needed on the init hook and die() if needed. This way you can also store the data wherever it is convenient for you.
For sure editing any wordpess core file is a big no-no which amount to forking wordpress with all the responsibilities it requires from you. The only file you may edit is wp-config.php but this should probably be done only if the plugin approach will not work
Related Posts:
- When to use Exceptions vs Error Objects vs just plain false/null
- WordPress URL Rewrite not working
- Detect a focus on wp_editor
- simple wordpress ajax plugin not working when not logged in
- Utilize WP-CLI from inside WordPress, not SSH
- Saving metabox repeatable fields
- how to create and show sessions in word press?
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Loading page template into shortcode
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- allow users to publish without admin approval
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Do my defines need to be unique?
- What does $wpdb->get_row return?
- WordPress Scheduled Event Request Blocking
- Delete a WordPress transient from a shortcode on Page/Post update
- Plugin CSS not enqueing
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Saving an array of dynamic repeater data as post_meta
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- Improve page speed loading using CDN and async or defer attribute
- Script to browser problem PHP
- Store a default value for a transient on plugin activation
- How wp-cron can run in background if PHP is single threaded?
- wp_head function not outputting
- wp query foreach deleting record returning only first or last item
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- WordPress Custom field Colors
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- Asynchronous multiple requests 401 Unauthorized
- Using data sent via AJAX in multiple functions on a WP plugin
- What does -> mean in WordPress?
- Usage of call back function of add_meta_box()
- Change product_base programmatically
- How to add the sidebar to all the pages except the home page? [closed]
- WordPress shortcode returns the data before
- Plugin development and composer
- How to Schedule Cronjobs for start of every month and year
- Set default Database Storage Engine when creating tables with plugins?
- custom post type with role Vendor
- Execute Jquery when a specific page in my plugin is loading
- How can I get plugin meta data without knowing the plugin folder?
- calling admin-ajax.php from admin-ajax.php
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- WordPress can’t use ZipArchive
- How to change basename url for wp-admin?
- Only the first image uploads
- WordPress loading progess – wp-blog-header.php
- Illegal string offset checkbox
- Custom plugin: how do I call a PHP file if settings option is set to true?
- Trying to use a variable to set image width
- wp_update_post gives 500 internal error
- Submit remote form to wordpress REST API and save data to custom post type
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- How to identify which php file a plugin is using on page load?
- dashboard widget form not submit mails
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- register_setting not save checkbox
- How to access this jQuery/AJAX data in a PHP file/WordPress plugin
- post_exists stops working in a scheduled event
- register dependency css and js inside a plugin class
- When I create a new custom post type, it replaces the old post type
- How does one make a URL return dynamic JSON with custom Content Type?
- How to give custom roles the capability to edit one Menu instead of every Menu
- add menu page in loop menu order
- Add .php to end of all WordPress Pages (multisite)
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Getting Member Data From WhishList Member on Register
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- PHP: Why does my code work in index.php but not a widget?
- global $post inside plugin query messes up every new post page in wp-admin
- wp_query (or hook) posts by date (id) in array then set post_type
- Chosen Select jquery Not Working in Plugin
- PHP calling function within a class
- Save data of select list after clicking save
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?
- Can’t remove menu items added by plugin
- Issues separating my Plugin pages into different files
- How to hide Ads From Certain Categories?
- I’m not able to get access $wpdb in my php file in wordpress
- Custom field fetch error on woocommerce pdf invoice
- Displaying custom meta box value in a custom post page
- Woocommerce Convert existing order to the cart
- Redirect posts to post editor page based on query string
- how to check elementor is widget is active or loaded
- Create a custom plugin with dynamic child pages listing database records
- Load style and script for custom post type metabox
- Issue with WordPress Plugin Activation Hook and Table Creation
- Too few arguments – wp_login action
- Cannot Access ACF Field Values via my Plugin