Include wp-load.php
, not wp-blog-header.php
. Better yet, hook onto the execution of a standard WordPress request and die early.
isset( $_GET['my_conditional_check'] ) && add_action( 'plugins_loaded', 'my_xml_output' );
function my_xml_output()
{
// do my stuff
exit;
}
This’ll run WordPress, then my_xml_output()
, then die before the request is actually parsed & the template is loaded/rendered:
http://example.com/?my_conditional_check
Related Posts:
- Is it mandatory to use $wpdb->prefix in custom tables
- WordPress and multithreading
- Actions or filters fired when data is saved in a custom table
- Custom Plugin Database relations
- Activation hook not creating table
- $wpdb -> Batch insert from XML File?
- include wp-blog-header not working on MAMP
- How to create database table, add data, update and delete using wpdb via plugins?
- wpdb->prepare and mysql UPDATE – how is it done?
- $wpdb->update Issue
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Update database record in plugin
- What method should I use to store my plugin data (multi level menus with options on each item)
- WordPress plugin tables become corrupt
- multiple record insert creating many duplicate records
- Should I use wpdb prepare?
- Post meta vs separate database tables
- Update Option Stored in Multi-Dimensional Array
- $wpdb->insert_id
- Writing a plugin that notify my friends of new post that mentions(@) them
- Getting wrong relationship value in $args in wp_Query?
- Not sure the best way to save custom plugin data
- The ideal place for storing persistent PHP objects
- What is the correct way for plugins to create tables with special charset/collation considerations?
- Plugin development with unit tests
- Formatting of curly brackets array from WP database to get more readable output
- How to modify post content before writing to database?
- Hello dolly type plugin that allows people to add their own
- Really simple query giving error in SQL syntax
- Sample — test — data for large WordPress install
- why creating tables using $wpdb is not being executed while installing plugins?
- Database for development
- Using $wpdb object in a widget
- Is there a naming convention for database tables created by a plugin?
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Saving data from block editor to the database
- What for the tables ending with the meta used in database of wordpress?
- How to Download and install plugin database remotely
- Get a custom table to an array
- How to insert data to a database table when the field is not yet created?
- Subscribe to author?
- I’m designing a plugin to create database indexes. Suggestions?
- creating custom function to log actions in plugin
- How should I store a log for my plugin
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Help With MySQL to WPDB Query Conversion
- Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin
- How to perform a heavy and long process in cron jobs?
- Adding custom end points, No error line
- Update results, Before deleting the related category [closed]
- dbDelta not installing database
- Is it necessary to do validation again when retrieving data from database?
- What is the best way to store a few fields?
- Adding columns to core tables
- How to query custom db table?
- Delete data from database using row action
- WPDB: Update table
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- Issue running db create table query from static method
- $wpdb->prepare with LIKE and sprintf
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- How to optimize multiple insert into wordpress database
- $wpdb->update() always need a second try
- Using AND and bracket grouping in SQL not working
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Proper Prepare Statement for ALTER TABLE and using AFTER
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- Save temporary registration data
- Plugin to create Posts and Forums then choose category and parent forum
- How to relate the Category to user?
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Error code when migrate
- Why User_login key doesn’t work with wp_update_user()
- How to store sensitive user data (passwords)
- WordPress Query doesn’t return the correct value
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Use admin-post to submit form data to external database
- User avatar-ACF fields
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- WordPress doesn’t create table on plugin activation
- Insert Data into Database
- pull data from wordpress database
- Dedicated server and WPDB Class : huge slow-down of the website
- How to implement pagination into a wpdb->result query?
- Ajax not working to insert, query and result data
- How to filter get_adjacent_post()?
- Associating special meaning with user id 0
- $wpdb how can i save my postmeta table before querying it
- Post data in wp-admin to external database
- mysql_real_escape_string() error using xml2ary in WordPress plugin
- Fixing plugin for wpdb::prepare
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- How to create a database table in WordPress using PHP
- Leveraging Core Functionality in Icon Upload Plugin [closed]
- Programmatically creating posts based on external JSON feed (asynchronously)
- WordPress database error: [Table ‘bitnami_wordpress.questions’ doesn’t exist]
- Making a user platform reachable by a qr code on a pin-back-button [closed]