I have multi-site with folder structure and url example_site.com, and I need URL structure of sub-site to be example_site.com/locations/state/city.
I can't find the right hook i even tried pre_get_posts hook to change all pages and post but its ugly solution and multi-site will have over 30 sites.
function filter_url( $url, $path, $blog_id, $scheme ) {
if($blog_id = 3){
$url = str_replace('/city/','/locations/state/city/',$url);
}
return $url;
};
If i try to echo the result of the function i get what i need but if I returned i get nothing