Support multisite with subdirectories in navigate
function
#53104
Replies: 0 comments 5 replies
-
Can we rely on the |
Beta Was this translation helpful? Give feedback.
-
I think we can't rely on the
That was my initial idea. I guess it will be helpful in more use cases. What I am not sure about is if this should be populated from the server using the |
Beta Was this translation helpful? Give feedback.
-
I think you can't get it reliably from |
Beta Was this translation helpful? Give feedback.
-
Yes, I think you can't. That's why I suggested using it as a fallback in case it is not defined from the server. |
Beta Was this translation helpful? Give feedback.
-
I don't think add_action( 'wp_head', function () {
printf( '<link rel="home" href="%s">', esc_url( get_home_url() ) );
} ); |
Beta Was this translation helpful? Give feedback.
-
As reported here, some sites use a subdirectory, so using a relative path in the
navigate
function won't work as expected. Imagine I have a multisite inmysite.com/en/
. If I callnavigate("/")
, it will navigate tomysite.com
instead ofmysite.com/en/
.Not sure what is the best way to handle this, but I assume the
navigate
function should be aware of this somehow. Should we expose the site URL in the store as discussed here? Should we populate the site URL in the SSR using theget_site_url()
function?Beta Was this translation helpful? Give feedback.
All reactions