You could do that, including wp-load.php
would bootstrap WordPress and allow you to query the database. I prefer to keep things encapsulated in plugins though, much more portable. You just need to hook early enough to send your own headers, and you can short-circuit the rest of the load process. For example-
function wpd_my_export_script() {
if( isset( $_GET['do_my_export_stuff'] ) ) {
header('Content-Type: application/xml; charset=utf-8');
// do your database stuff
exit;
}
}
add_action( 'wp_loaded', 'wpd_my_export_script' );
Then visiting http://example.com/?do_my_export_stuff
will trigger your code.
Related Posts:
- How do I comment out a block of tags in XML?
- What does
- How to use XPath contains() here?
- Looking for a clear description of Excel’s .xlsx XML format
- Parse XML using JavaScript [duplicate]
- (Python) AttributeError: ‘NoneType’ object has no attribute ‘text’
- XSLT-FO for-each
- java.net.MalformedURLException: no protocol
- Meaning of –
- XSLT for each loop on simple XML
- Is XML a programming language?
- XML Parsing Error: not well-formed
- XPath: Get parent node from child node
- What is the difference between Inclusive and Exclusive OR?
- Manifest Merger failed with multiple errors in Android Studio
- xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?
- How can I escape “&” in XML?
- How to fix error: The markup in the document following the root element must be well-formed
- What’s “tools:context” in Android layout files?
- How to add a newline (line break) in XML file?
- Error -1072896636 “DTD Prohibited” when opening xml file in Excel, what do I do?
- How to define xsi:type as an attribute in XML-schema?
- What are invalid characters in XML
- How to implement if-else statement in XSLT?
- The ‘packages’ element is not declared
- Getting attribute using XPath
- understanding position() function in XSLT
- android.support.design.widget.CoordinatorLayout error
- How to parse XML in Bash?
- YAML compared to XML
- URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs) in applicationContext.xml
- Import WordPress xml file larger than 8mb
- parse XML from URL (via SOAP)
- How can I bulk update all posts without making changes?
- Problems with creating hook that updates XML
- Features in Houzez are not loading in Backend from API
- WP All Import: Feeds of Feeds [closed]
- Is there an XML Web Service that can get posts, categories and other data from the site?
- Receive error exception using xampp with wordpress
- Work with xml file and WordPress
- Moving WordPress to a different directory – update XML Post File?
- WordPress importer / problem with images
- stop duplicate post
- Importing feeds with PHP
- Create XML sitemap in wordpress
- How to make an xml file (just the xml file) available at a specific url?
- problem of path with xml file
- xml generator script wordpress [closed]
- How do I comment out a block of tags in XML?
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- Opening JSF Facelets page shows “This XML file does not appear to have any style information associated with it.”
- XML Parsing Error: no root element found Location in Console FF
- “ArrayAdapter requires the resource ID to be a TextView” XML problems
- How to read and write XML files?
- Root element is missing
- What is ?
- Read XML file using javascript
- Why this line xmlns:android=”http://schemas.android.com/apk/res/android” must be the first in the layout xml file?
- Error: The processing instruction target matching “[xX][mM][lL]” is not allowed
- How to set menu to Toolbar in Android
- XSLT Transform XML with Namespaces
- Embed podcast feed in wordpress
- Initialize WordPress environment to use in command line script
- How to load WordPress on non WP page?
- Notice: map_meta_cap was called incorrectly
- Creating a Dynamic Path to wp-blog-header.php
- Problem accessing wp-load.php
- WordPress import does not fetch images, but just links them
- XML export posts from one single day
- update_option not working in stand-alone PHP script
- WordPress function gives different results outside vs inside PHPUnit test
- How to avoid wp-load.php within a PHP/CSS file?
- How do you load WordPress from an external script when using MultiSite? [duplicate]
- Call to undefined function issue
- Importing wordpress. xml file on new installation
- How to avoid loading wp-load.php from external php scripts?
- XML asset fails to load using https
- Generate/save JSON or XML file from JSON script
- How to access $menu variable in custom .PHP file that loads wp-load.php?
- Export xml use/import images from theme directory
- WP CLI can’t delete plugin related table
- What hook is the currently active theme’s functions.php file loaded on? [duplicate]
- WordPress Nexus Theme front-end editor broken because cannot find wp-load.php [closed]
- Fetching latest posts from 2 different WP installations
- RSS/Atom feeds invalid, “Mismatched tag” errors
- PHP mobile redirect Endless loop
- how to convert XML from URL to HTML
- Error in importing wordpress xml [closed]
- Export post data with xml to other site using php soap
- WordPress create custom XML RSS feed template
- how to define a html folder to make it work with WordPress commands
- How to import several big Import XMLs?
- How can I export data without using any import/export plugin
- How to replace a specific html tag in bulk?
- Bulk insert posts is really slow and skips entries
- WordPress removes namespace part from my tags in RSS feed
- Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC
- Adapting a php array to WordPress
- Get Core Functionality from Within a (Secondary) Plugin File
- How to update post meta with xml data