On this page
get_edit_profile_url( int $user_id, string $scheme = 'admin' ): string
Retrieves the URL to the user’s profile editor.
Parameters
$user_idint Optional-
User ID. Defaults to current user.
$schemestring 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:
'admin'
Return
string Dashboard URL link with optional path appended.
Source
File: wp-includes/link-template.php. View all references
function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
$user_id = $user_id ? (int) $user_id : get_current_user_id();
if ( is_user_admin() ) {
$url = user_admin_url( 'profile.php', $scheme );
} elseif ( is_network_admin() ) {
$url = network_admin_url( 'profile.php', $scheme );
} else {
$url = get_dashboard_url( $user_id, 'profile.php', $scheme );
}
/**
* Filters the URL for a user's profile editor.
*
* @since 3.1.0
*
* @param string $url The complete URL including scheme and path.
* @param int $user_id The user ID.
* @param string $scheme Scheme to give the URL context. Accepts 'http', 'https', 'login',
* 'login_post', 'admin', 'relative' or null.
*/
return apply_filters( 'edit_profile_url', $url, $user_id, $scheme );
}
Hooks
- apply_filters( 'edit_profile_url',
string $url ,int $user_id ,string $scheme ) -
Filters the URL for a user’s profile editor.
Related
Uses
| Uses | Description |
|---|---|
| is_user_admin() wp-includes/load.php | Determines whether the current request is for a user admin screen. |
| is_network_admin() wp-includes/load.php | Determines whether the current request is for the network administrative interface. |
| get_dashboard_url() wp-includes/link-template.php | Retrieves the URL to the user’s dashboard. |
| user_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the current user. |
| network_admin_url() wp-includes/link-template.php | Retrieves the URL to the admin area for the network. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| get_current_user_id() wp-includes/user.php | Gets the current user’s ID. |
Used By
| Used By | Description |
|---|---|
| WP_Widget_Custom_HTML::add_help_text() wp-includes/widgets/class-wp-widget-custom-html.php | Add help text to widgets admin screen. |
| default_password_nag() wp-admin/includes/user.php | |
| WP_Customize_Manager::register_controls() wp-includes/class-wp-customize-manager.php | Registers some default controls. |
| get_edit_user_link() wp-includes/link-template.php | Retrieves the edit user link. |
| wp_admin_bar_my_account_item() wp-includes/admin-bar.php | Adds the “My Account” item. |
| wp_admin_bar_my_account_menu() wp-includes/admin-bar.php | Adds the “My Account” submenu items. |
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_edit_profile_url