Opened 2 years ago
Last modified 8 months ago
#60371 new defect (bug)
get_home_path fails in headless mode.
| Reported by: | fishpig | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | 6.4.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
The core get_home_path function is incorrect when in a headless mode and siteurl and home are different.
The easy fix for this is to just add a filter to the return value so that we can return ABSPATH
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
To call this function you neew to do this.
Note that get_home_path() is declared in wp-admin/includes/file.php which is not included by default, except on admin pages when wp-admin/includes/admin.php has been included.
Ensure get_home_path() is declared.
require_once ABSPATH . 'wp-admin/includes/file.php';
$home_path = get_home_path();