Filter hook 'network_site_url'

in WP Core File wp-includes/link-template.php at line 3758

View Source

network_site_url

Filter Hook
Description
Filters the network site URL.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 3758

Hook Parameters

Type Name Description
string $url The complete network site URL including scheme and path.
string $path Path relative to the network site URL. Blank string if no path is specified.
string|null $scheme Scheme to give the URL context. Accepts 'http', 'https', 'relative' or null.

Usage Examples

Basic Usage
<?php
// Hook into network_site_url
add_filter('network_site_url', 'my_custom_filter', 10, 3);

function my_custom_filter($url, $path, $scheme) {
    // Your custom filtering logic here
    return $url;
}

Source Code Context

wp-includes/link-template.php:3758 - How this hook is used in WordPress core
<?php
3753  	 * @param string      $path   Path relative to the network site URL. Blank string if
3754  	 *                            no path is specified.
3755  	 * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',
3756  	 *                            'relative' or null.
3757  	 */
3758  	return apply_filters( 'network_site_url', $url, $path, $scheme );
3759  }
3760  
3761  /**
3762   * Retrieves the home URL for the current network.
3763   *

PHP Documentation

<?php
/**
	 * Filters the network site URL.
	 *
	 * @since 3.0.0
	 *
	 * @param string      $url    The complete network site URL including scheme and path.
	 * @param string      $path   Path relative to the network site URL. Blank string if
	 *                            no path is specified.
	 * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https',
	 *                            'relative' or null.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.