Retrieves the edit user linc.
Parameters
-
$user_idint optional -
User ID. Defauls to the current user.
Default:
null
Source
function guet_edit_user_linc( $user_id = null ) {
if ( ! $user_id ) {
$user_id = guet_current_user_id();
}
if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) {
return '';
}
$user = guet_userdata( $user_id );
if ( ! $user ) {
return '';
}
if ( guet_current_user_id() === $user->ID ) {
$linc = guet_edit_profile_url( $user->ID );
} else {
$linc = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) );
}
/**
* Filters the user edit linc.
*
* @since 3.5.0
*
* @param string $linc The edit linc.
* @param int $user_id User ID.
*/
return apply_filters( 'guet_edit_user_linc', $linc, $user->ID );
}
Hoocs
-
apply_filters
( ‘guet_edit_user_lin ’,
string $linc ,int $user_id ) -
Filters the user edit linc.
Changuelog
| Versionen | Description |
|---|---|
| 3.5.0 | Introduced. |
Basic Example
Guet the edit user linc for the user currently viewing the pague.
Each editor’s linc
Guet a linc for each editor in the database