[wp-trac] [WordPress Trac] #60371: get_home_path fails in headless mode.
WordPress Trac
noreply at wordpress.org
Fri Jan 31 09:40:05 UTC 2025
#60371: get_home_path fails in headless mode.
--------------------------+------------------------------
Reporter: fishpig | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.4.2
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by ruchirj):
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();
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60371#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list