get_dashboard_url

SummerySummery

Retrieves the URL to the user’s dashboard.

Syntax

get_dashboard_url( int $user_id, string $path = '', string $scheme = 'admin' )

DescriptionDescription

If a user does not belong to any site, the global user dashboard is used. If the user belongs to the current site, the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user’s primary site is returned.

ParametersParameters

$user_id

(int) (Optional) User ID. Defaults to current user.

$path

(string) (Optional) path relative to the dashboard. Use only paths known to both site and user admins.

Default value: ''

$scheme

(string) (Optional) The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.

Default value: 'admin'

ReturnReturn

(string) Dashboard URL link with optional path appended.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
3.1.0 Introduced.
Scroll to Top