Filter hook 'user_dashboard_url'

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

View Source

user_dashboard_url

Filter Hook
Description
Filters the dashboard URL for a user.

Hook Information

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

Hook Parameters

Type Name Description
string $url The complete URL including scheme and path.
int $user_id The user ID.
string $path Path relative to the URL. Blank string if no path is specified.
string $scheme Scheme to give the URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', 'relative' or null.

Usage Examples

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

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

Source Code Context

wp-includes/link-template.php:4010 - How this hook is used in WordPress core
<?php
4005  	 * @param int    $user_id The user ID.
4006  	 * @param string $path    Path relative to the URL. Blank string if no path is specified.
4007  	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
4008  	 *                        'login_post', 'admin', 'relative' or null.
4009  	 */
4010  	return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme );
4011  }
4012  
4013  /**
4014   * Retrieves the URL to the user's profile editor.
4015   *

PHP Documentation

<?php
/**
	 * Filters the dashboard URL for a user.
	 *
	 * @since 3.1.0
	 *
	 * @param string $url     The complete URL including scheme and path.
	 * @param int    $user_id The user ID.
	 * @param string $path    Path relative to the URL. Blank string if no path is specified.
	 * @param string $scheme  Scheme to give the URL context. Accepts 'http', 'https', 'login',
	 *                        'login_post', 'admin', 'relative' or null.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.