让我们check the Codex 并按照链接the source:
3029 function network_home_url( $path = \'\', $scheme = null ) {
3030 if ( ! is_multisite() )
3031 return home_url($path, $scheme);
3032
3033 $current_site = get_current_site();
3034 $orig_scheme = $scheme;
3035
3036 if ( ! in_array( $scheme, array( \'http\', \'https\', \'relative\' ) ) )
3037 $scheme = is_ssl() && ! is_admin() ? \'https\' : \'http\';
3038
3039 if ( \'relative\' == $scheme )
3040 $url = $current_site->path;
3041 else
3042 $url = set_url_scheme( \'http://\' . $current_site->domain . $current_site->path, $scheme );
3043
3044 if ( $path && is_string( $path ) )
3045 $url .= ltrim( $path, \'/\' );
3046
3047 /**
3048 * Filter the network home URL.
3049 *
3050 * @since 3.0.0
3051 *
3052 * @param string $url The complete network home URL including scheme and path.
3053 * @param string $path Path relative to the network home URL. Blank string
3054 * if no path is specified.
3055 https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-includes/link-template.php#L3029 * @param string|null $orig_scheme Scheme to give the URL context. Accepts \'http\', https://core.trac.wordpress.org/browser/tags/4.3.1/src/wp-includes/link-template.php#L3029\'https\',
3056 * \'relative\' or null.
3057 */
3058 return apply_filters( \'network_home_url\', $url, $path, $orig_scheme);
3059 }
我们看到,是的,有一个过滤器叫做
network_home_url
我们可以用它来改变链接。下面这样一个简单的过滤器可以做到这一点,但我怀疑您是否希望在实践中得到这种简化:
function alter_net_link_wpse_206603($url, $path, $orig_scheme) {
return \'http://myexample.com/member\';
}
add_filter(\'network_home_url\',\'alter_net_link_wpse_206603\',10,3);