Filter hook 'user_admin_url'

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

View Source

user_admin_url

Filter Hook
Description
Filters the user admin URL for the current user.

Hook Information

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

Hook Parameters

Type Name Description
string $url The complete URL including scheme and path.
string $path Path relative to the URL. Blank string if no path is specified.
string|null $scheme The scheme to use. Accepts 'http', 'https', 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().

Usage Examples

Basic Usage
<?php
// Hook into user_admin_url
add_filter('user_admin_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:3876 - How this hook is used in WordPress core
<?php
3871  	 * @param string      $path   Path relative to the URL. Blank string if
3872  	 *                            no path is specified.
3873  	 * @param string|null $scheme The scheme to use. Accepts 'http', 'https',
3874  	 *                            'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
3875  	 */
3876  	return apply_filters( 'user_admin_url', $url, $path, $scheme );
3877  }
3878  
3879  /**
3880   * Retrieves the URL to the admin area for either the current site or the network depending on context.
3881   *

PHP Documentation

<?php
/**
	 * Filters the user admin URL for the current user.
	 *
	 * @since 3.1.0
	 * @since 5.8.0 The `$scheme` parameter was added.
	 *
	 * @param string      $url    The complete URL including scheme and path.
	 * @param string      $path   Path relative to the URL. Blank string if
	 *                            no path is specified.
	 * @param string|null $scheme The scheme to use. Accepts 'http', 'https',
	 *                            'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.