Opened 16 months ago
Last modified 3 months ago
#60371 new defect (bug)
get_home_path fails in headless mode.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.4.2 |
Component: | General | Keywords: | |
Focuses: | Cc: |
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.
To call this function you need 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();