Pretty much wp-load.php
is the only way to go. I don’t think there is really another way to load the WordPress functions safely…
You can account for path variations by recursively including it from any file where you need it though… eg.
function file_find_require($file,$folder=null) {
if ($folder === null) {$folder = dirname(__FILE__);}
$path = $folder.DIRECTORY_SEPARATOR.$file;
if (file_exists($path)) {require($path); return $folder;}
else {
$upfolder = file_find_require($file,dirname($folder));
if ($upfolder != '') {return $upfolder;}
}
}
$rootpath = file_find_require('wp-load.php');
Related Posts:
- API integration with WordPress
- I want to retrieve all posts of a blog without username & password
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- This page didn’t load Google Maps correctly. See the JavaScript console for technical details
- Constructing requests with URL Query String in Python
- Postman Resolving “Invalid CORS request” for a POST Request
- WordPress Rest API custom endpoint optional param
- WP function/filter for modifying http headers?
- Create API for single sign-on with 3rd party site
- Set up WP Authentication from External API
- How do I cache (core) API requests?
- Slow REST API calls on self-hosted WordPress [closed]
- WordPress JSON output
- how to authenticate for the REST API from a plugin and from command line
- External WordPress API
- WordPress API – Get Drafts
- How to stop WP API endpoint from caching?
- How to implement ERP (Enterprise Resource Planning) into WordPress?
- POST to a REST API from a wordpress form
- Gutenberg internal page link search box
- get WP-API by page id
- Sync posts from one WordPress site to another
- Passing variables to new page
- Developing Themes with React/Angular
- WordPress API – count posts
- Creating external apps WordPress / How they work
- API in numbers?
- Does WordPress support a shortcode calling itself from within a shortcode call?
- Stuck with wp_remote_post sending data to an external api on user registration
- API for Post Stats for Self-Hosted WordPress using JetPack [closed]
- Create post with REST API in php with file_get_contents
- How to get WordPress Plugins Data in PHP using Plugin API?
- Displaying Content with WP Rest API
- How to integrate Yelp API
- Where to find WordPress API changes for each version released
- Custom Post for Locating by Google Maps API
- How to Increase WordPress JSON API Speed?
- How can I cache WordPress Rest API Response
- WordPress REST API always misses parameters – rest_missing_callback_param
- Unable to find API Key for my blog
- Develop REST API using WordPress for Android app [closed]
- Why aren’t tags and categories added in post request to WP Rest API
- get_option() fails to return binary result
- Integrate ZOHO Recruit API?
- Allow logged in WordPress user to access 3rd party Laravel API via OAuth
- For using google api is it necessary to install the google client libraries for using Oauth 2 in wordpress installation?
- WC REST Payment – Stripe Gateway’ is not available
- PHP to Handle API Return instead of print
- Enabling CORS with WordPress
- How do I query my WordPress posts on another HTML page using the WordPress Restful API?
- body_class REST field in WP-API
- Authenticating a user with the WP-API V2 in Postman
- WP OAuth Server “The grant type was not specified in the request”
- Theme Customizer API Live Preview
- How to query WordPress from another application?
- Integrate product feed API in Woocommerce [closed]
- WordPress keeps autoplaying my Youtube-Links no matter what I write
- How to fix AWS SNS API end point code that cause site not to load?
- Integrating API in to WordPress
- WP REST API and Access-Control-Allow-Origin
- How to convert and use JSON data from a remote WordPress server?
- How to get the post_id after you successfully create new post using xmlrpc api wp newPost?
- Soundcloud Smart Player
- Jetpack JSON API configure button not showing [closed]
- New Twitter API and Twitter count + timeline doesn’t work anymore [closed]
- wp_signon returns user but the user is not logged in because wp installed on subdomain. How to make it work?
- get_pages and get_posts returning different data?
- hybridauth (google OAuth integration) and WP problems
- Working Around rest_forbidden_context
- How to queue API requests with PHP in WordPress?
- How to store API authentication password?
- WordPress and API (rapidapi) request
- Post content in wp_remote_post
- I need some assistance opening a few videos in VLC on android automatically from my wordpress site
- Call external API
- Get total count of records in WP GraphQL API
- Intergrate JSON into wordpress
- WordPress json rest api displaying 10 categories only
- Creating posts, containing data from remote API
- Passing data outside of WordPress possible?
- Gravit Forms Notification send after 3rd party API response
- Periodically Query an external API on wordpress site
- Post to WordPress API using cURL and login cookies
- Extending the API I created to return category names
- Expand author, tags and categories in the WordPress JSON API
- How to display parent category with first level child in REST API
- Best way to make a JSON API from WordPress?
- Encrypt API key [duplicate]
- Can I get the post id when trying to make a new post using xmlrpc?
- Using PHP Api wrapper within plugin. Wrapper uses name space
- Querying Posts Using JSON API
- basic wordpress api endpoint to serve a key-value dictionary
- Trying to integrate wordpress query on other website – getting redirection to wp-install
- Is it possible to make website content available on another website?
- How to login via wordpress api and get user details?
- Zoho subscription API to WordPress [closed]
- How many users/load can the rest API handle?
- How get JSON from external API on every page load if not existing in transient?
- XMLRPC: How to retrieve possible custom fields for a new post?
- Using WordPress API to mass update posts freezes the server