[wp-trac] [WordPress Trac] #60622: Enhancement: add filter to function get_home_path() return value

WordPress Trac noreply at wordpress.org
Fri Feb 23 11:14:41 UTC 2024


#60622: Enhancement: add filter to function get_home_path() return value
----------------------------+-----------------------------
 Reporter:  alexrah         |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  6.4.3
 Severity:  normal          |   Keywords:  dev-feedback
  Focuses:                  |
----------------------------+-----------------------------
 Allowing to filter the return value of wp-
 admin/includes/file.php:get_home_path() would help to handle cases when
 WordPress is used as an headless Rest API backend and wp_options home
 points to a different domain than siteurl.

 In such a case, get_home_path fails to get the absolute filesystem path of
 the root of the WordPress installation.

 Being able to filter the output of get_home_path() would allow developers
 to avoid breaking its functionality on headless setup.

 Why is important: in a headless setup, having wp_options home set to the
 frontend domain allow WordPress to generate user-facing urls with the
 correct domain.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60622>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list