Remove WPML’s home_url filter

I found that it required removing 4 filters/actions to undo WPML’s home_url modification. Since I didn’t know what else this might break, I ended up changing my site’s logo to use site_url() which in my case was the same, but not changed by WPML. function disable_things(){ remove_filter( ‘page_link’, array( $this, ‘permalink_filter’ ), 1, 2 ); … Read more

What’s the difference between home_url() and get_home_url() from a developmental point of view?

There isn’t much difference but they are not the same. get_home_url get_home_url() takes null or a blog id as the first parameter. As per documentation here. get_home_url( int $blog_id = null, string $path=””, string|null $scheme = null ) If you are dealing with multiple homes (as in, say a multi-site set up) this might be … Read more

Difference between bloginfo(‘home’) and home_url() and site_url()

The difference in your case is in filters being applied to output of these functions. While bloginfo applies one of these filters: if ( ‘display’ == $filter ) { if ( $url ) $output = apply_filters(‘bloginfo_url’, $output, $show); else $output = apply_filters(‘bloginfo’, $output, $show); } Function home_url applies this filter: return apply_filters( ‘home_url’, $url, $path, … Read more

Getting the Site URL Including the Front Base

You can get the value of front in the global $wp_rewrite: global $wp_rewrite; echo $wp_rewrite->front; // or echo home_url( $wp_rewrite->front ); Though that is probably of limited use, as the front base isn’t necessarily an existing page, and may 404 in many cases. If you’re using that value to prepend to other URLs, you’re likely … Read more