Questions tagged [wp-load.php]

Bootstrap file for setting the `ABSPATH` constant and loading the `wp-config.php` file. The `wp-config.php` file will then load the `wp-settings.php` file, which will then set up the WordPress environment.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Error Class not found when include(wp-load.php) with File Upload Type WPForms On

Hello I wanted to ask about some error on WP, I just add/include(wp-load.php) so my own plugin can use wp short_code and check if it's logged in or not, but now I've problem with existing plugin, that'...
0
votes
0answers
14 views

How to identify what page when using wp-load.php

When using WordPress, I can easily identify pages using is_page('100') or is_front_page(), is_home, is_single() etc... But, I have built a custom PHP script and included into WordPress using: define( '...
0
votes
1answer
43 views

Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin

I created a plugin TESTPLUGIN and added it on wordpress admin menu. I can access the plugin from the admin menu just well. The problem I am having is how to link to another file within the plugin. The ...
0
votes
0answers
9 views

How a Wordpress page is called in Python and then displayed on screen

I am newbie to coding and its my first project in which I need to fetch a particular page from a wordpress website and display on a screen using python. In my project I am using a proximity sensor ...
0
votes
0answers
21 views

Calling wp-load from a subdomain of a site not using wordpress

I am building a mobile specific site that does lots of things. One of these things is get data from the primary wordpress website. I had assumed I could just call wp-load.php from the subdomain and it ...
0
votes
0answers
21 views

Trying to use a couple of WP functions outside of WP directory, but i also need theme's functions.php?

I am developing a little map application outside my WP directory, but i like to use some WP functions. It all seems to almost work when i use define('SHORTINIT', true); But i also need the functions....
0
votes
1answer
85 views

WordPress Nexus Theme front-end editor broken because cannot find wp-load.php [closed]

I’ve got a Nexus Theme (https://nexusthemes.com/) that stopped allowing me to edit through the frontend. Gives an “Error transferring data. Please try again later.” Console reports “Could not find wp-...
0
votes
0answers
102 views

Doesn’t call user information to include “wp-load.php” in an external php file

Doesn't call user information to include "wp-load.php" in an external php file. <?php require_once( dirname( dirname( __ FILE __ ) ) . '/wp-load.php' ); global $wpdb, $user_ID; echo $user_ID; // ...
1
vote
0answers
70 views

How to access $menu variable in custom .PHP file that loads wp-load.php?

I have a file custom.php inside the WP root folder. My goal is to access the GLOBAL $menu variable that stores the admin menu items. In order to do that, I try loading the WordPress environment. <?...
1
vote
1answer
805 views

wp-load.php not working

I'm using require_once(../../../../wp-load.php), which is the correct relative path to the file, but it doesn't work. If I use wp-blog-header.php instead, that works and enables me to use WP functions....
3
votes
2answers
1k views

Problem accessing wp-load.php

I'm writing a standalone script for Wordpress so I can display things like the username on a page outside of Wordpress. My method so far is to try to include or require wp-load.php in my script ...
-1
votes
1answer
922 views

How to include wp-load.php and have all plugins load as well

Why load wp-load.php 'use wordpress ajax instead' no This is for testing only. I have a test page I use for local development only, e.g. test.php in my themes folder Now when I do this: global $...
1
vote
0answers
57 views

getting logged in user info (wp-load.php) from parent directory

Directory structure: https://www.example.com/test.php https://www.example.com/blog/wp-load.php test.php: require_once("blog/wp-load.php"); global $current_user; get_currentuserinfo(); print_r($...
0
votes
2answers
38 views

WP CLI can't delete plugin related table

I have installed a plugin following wp plugin install ... CLI command and then activate through CLI command its working properly. But problem is that when I deactivate then delete the plugin the table ...
0
votes
0answers
42 views

Which position is after `wp-load.php`?

i.e. instead of this code: include_once(...'/wp-load.php'); add_action('init', 'my'); function my(){ if(current_user_can('manage_options')){ ..... } } we can simply use: include_once(...'/...
1
vote
0answers
682 views

Cron job script - loading wordpress system fails

I want to run a cron job that fetches data from an api and stores it in a database table. I don't use "wp-cron". I load a script in a folder inside the theme. But I need to load the wordpress system ...
0
votes
1answer
58 views

Fetching latest posts from 2 different WP installations

I have three WordPress installations (cannot use multisite; cannot use RSS/Atom feeds) and I am trying to display a date-sorted list of the latest 10 posts from each of the two sub-sites on the main ...
0
votes
1answer
1k views

wp-load Without Loading the plugins

I am building a 'control panel', for my server and would like to use my Wordpress userbase to control the login functionality, as well as be able to show some posts. I have set some defines and ...
0
votes
1answer
3k views

How can I call wp-load.php in my plugin file

I need to call wp-load.php in my plugins file but in case if I call it directly the plugin is not being accepted for wordpress repository and we are been given issue. So please guide me how can we ...
0
votes
2answers
168 views

How to get option values without requiring wp-load?

I am developing theme to sell on themefores. I want to get option values in the head. but as the checkoptions would not be called yet i need to call wp-load.php. but the reviewer from themeforest ...
0
votes
1answer
72 views

What hook is the currently active theme's functions.php file loaded on? [duplicate]

At which point of hook execution is the currently activated theme's functions.php file loaded?
0
votes
1answer
72 views

<link rel=“icon” href=“”> Causing my Wordpress functions to execute twice

As my title says, today I spent more than 5 hours figuring out why when I tried to add a new activity to buddypress (via bp_activity_add) It would be added twice or even three times. I started ...
0
votes
1answer
9k views

Proper way to use WordPress function with AJAX PHP file

I have the following jQuery function in my custom-js.js file: $(function() { $(".product-vote-button-up").click(function(){ var productID = $(this).attr('productID'); ...
1
vote
0answers
199 views

Programmatically inserting post through URL - when including wp-load.php, it's redirecting to wp-admin/install.php

I am trying to insert a post programmatically. A file is placed in the same directory where WordPress is installed. When I try to include wp-load.php, it is redirecting to wp-admin/install.php and ...
0
votes
1answer
573 views

Error establishing a database connection - after updating DNS

I have created website on my server, and i have bought hosting from a company and then I updated the DNS IP, after that when i try to open this website it opened fine but sometimes it gives me this ...
0
votes
0answers
236 views

Exploiting WordPress Core Functionality for Development

As WordPress is one of the Most Popular platform for the development, I searched and read 100s of articles to understand that if I can harness the power of wordpress (Like its security and db class). ...
4
votes
1answer
7k views

WP-Admin not working properly at Wordpress multisite with subdirectories

I have recently installed a Wordpress Multisite Blog on my domain. Everything is working fine, except for wp-admin of the subsites: I can access wp-admin of a subsite, but css is not loaded and when ...
1
vote
1answer
1k views

Accessing the database from a plugin outside of action hooks

I am working on a plugin that provides an endpoint for handling OAuth2 authorization against a remote server, on successful authorization stores some information from that server in the Wordpress ...
4
votes
3answers
5k views

Notice: map_meta_cap was called incorrectly

I created an external script to import json data into a custom post type that uses wp-load.php. Everything works fine but after every update I get the message Notice: map_meta_cap was called ...
1
vote
1answer
909 views

How to avoid loading wp-load.php from external php scripts?

i use slim with wordpress. This worked flawlessly so far. Well almost. Once I changed to multisite I had to start fake creating $_SERVER variables faking a domain name. But it worked finally. What I ...
2
votes
2answers
1k views

do_action and hook methods

I am trying to understand how hook methods work in WordPress. I understand that when do_action is called WP looks for all registered listeners and invokes them according to set priority. How does ...
-2
votes
1answer
299 views

how to use header function in wp-load.php file [closed]

I am making a file that is used for downloading files that are stored in my website. But when I try to download the file on clicking a button, it does not load the file. I am using header function to ...
0
votes
1answer
378 views

Looking for a better way to handle an ajax script that pulls in post data on click

I've developed a template page that displays a grid of "employees" (a custom post type). That part works fine, but I also needed to set up a lightbox to display additional details on click. To avoid ...
4
votes
3answers
5k views

When is wp_loaded initiated only with admin or only when user enters the site or both?

When is wp_loaded initiated? Im trying to add function that downloads a big file for the plugin DB, and I need it to be executed whenever user/admin/unknown user get in the frontend, after the site ...
0
votes
2answers
139 views

Retrieve data from multiple Wordpress sites using PHP script

I want to run a PHP script that iterates over WordPress sites found in a certain folder and read the plugins info per each site using get_plugin function In the code below, I try to require API ...
0
votes
1answer
100 views

Rewritten URL not loading WordPress environment

I have a page that I am sending users directly to so I can serve them a PDF dynamically created using the FPDF library. Since I'm sending them directly to the file which generates the PDF, I'm ...
0
votes
2answers
7k views

Use wp-load() and wp_head() to render a page's header outside of WordPress

I use wp-load() to load the basic WP environment and then read some info from the DB without any problem. But now i need to render the full header for a page, including the Yoast SEO plugin. After ...
0
votes
1answer
2k views

WP_load, shortinit for wordpress Ajax

We have been using wp-load.php for ajax load. it's for showing a popup when you click "preview". As you may know it takes very long time (3~4 sec) for get even a few texts. We have searched and found ...
1
vote
2answers
645 views

Issue using wp-load.php in WordPress Plugin Development

Why it is bad to use this include("../../../wp-load.php"); ?? What is the proper way of use this?? Thanks
0
votes
1answer
103 views

I need a standalone script in web root but still have access to the database

I am building a specialized xml output script (can't use the built in export) and I have a file in the web root that I can call from the URL domain.com/myscript.php. However, I need to be able to do ...
1
vote
0answers
580 views

Wordpress server change - slow admin login time for first time

I have a large Wordpress site. On local system we create a git repo for deploy a local version of Wordpress to DigitalOcean VPS servers. All Works great, but here is a problem to update a sql ...
0
votes
1answer
507 views

Using wpdb without loading all plug-ins via wp-load.php

I'm trying to prevent WP from loading all plug-ins when including wp-load.php, since I don't really need them nor the usual WP actions/filters. All I need is the WPDB class to query the database ...
0
votes
0answers
191 views

What is the best practice to initialise $wpdb by loading wp-load.php?

Why do users with high reputations suggest loading wp-load.php with a full path? My question is simple and was originally intended as an answer to this question. However I do not have a high enough ...
0
votes
1answer
1k views

Best way to load WordPress Bootstrap

My script needs to load the whole WP in order to work probably. I'm currently doing it this way if ( !defined('ABSPATH') ) { /** Load WordPress Bootstrap */ @ini_set('include_path', '../../.....
0
votes
1answer
420 views

External PHP file & Pretty Permalink

I'm working in developing REST API for a WP based website. Endpoint is http://example.com/api.php I've included wp-load.php in the top of the file to access WP functions etc. However, http://example....
0
votes
1answer
199 views

Manually cache a special, non-WP-but-using-WP page (e.g. Ajax results) with W3TC

Under the active theme folder, I have a search-autocomplete.php file which uses various WP queries to create smart JSON results delivered via AJAX to a jQuery UI Autocomplete input field. It's not a ...
2
votes
1answer
898 views

Admin first hook that outputs HTML?

I think load-(page) is the first hook in the admin screen that deals with outputting HTML, but I'm not totally sure. Basically I'm looking for the equivalent to template_rediect or get_header, which ...
0
votes
1answer
59 views

Take control of WordPress before functions.php

I'm developing theme and I want to make page cache of static pages in my WordPress theme (and basically I know how to implement it) The problem is that when making theme - the first time when I "get ...
1
vote
2answers
758 views

Create a post variable processing page

I need to create a blank PHP page that processes a POST request. Basically, a site will send me a few post variables. I need to use these variables with the mycred plugin. Here is my code: ...
2
votes
1answer
300 views

WordPress function gives different results outside vs inside PHPUnit test

I've been working very hard to get PHPUnit to play nice with WordPress (with the help of this, this, this, this, and this), and I think I've gotten pretty close. The code I run directly before my ...