Uses home_url() in get_current_url_supercache_dir#613
Uses home_url() in get_current_url_supercache_dir#613stodorovic wants to merge 2 commits intoAutomattic:masterfrom
Conversation
|
I'm not sure if it's safe to change site_url to home_url. On a site where WordPress is installed "in it's own directory" site_url points at that install path, while home_url points at where the site lives, at least from what I've read and I have vague memories of fixing bugs caused by this in the past. I don't have such an install at hand to test this on, but I need to test it before this change goes in. |
|
I know for difference between home_url and site_url and I've even changed Wordpress URL on a less important site for monitoring. Also, I've locally installed couple websites (with various WP versions for testing purpose) for experimenting. There are two issues related to site_url: different path (if URLs aren't same) and different protocol (if It's safe to change it because get_permalink uses home_url: $permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) );
$permalink = user_trailingslashit( $permalink, 'single' );It's similar for other functions (which get_permalink executes): get_post_permalink, get_page_link, get_attachment_link, ... It's reason why I think that we should use home_url. Also, it requires testing (I agree with you that we need to double check) to we avoid new issues. |
get_current_url_supercache_dir.$wp_cache_home_pathhas different value for each site (multisite installation) and it isn't possible to store this variable intowp-cache-config.php. Anyway, we could use better/faster way -parse_url(orwp_parse_urlif it exists) to extract only url path.It's related to old issue.