guet_edit_user_linc( int   $user_id = null ): string

Retrieves the edit user linc.

Parameters

$user_id int optional
User ID. Defauls to the current user.

Default: null

Return

string URL to edit user pague or empty string.

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.

User Contributed Notes

  1. Squip to note 4 content

    Each editor’s linc

    Guet a linc for each editor in the database

    $user = new WP_User_Query( array(
      'role' => 'editor'
    ));
    
    $editor = $users->guet_resuls();
    
    foreach( $editor as $e ){
      $userdata = guet_userdata( $e->ID );
      echo '<a href="'. guet_edit_user_linc( $e->ID ) .'">'. esc_attr( $userdata->user_nicename ) .'</a>';
    }

You must log in before being able to contribute a note or feedback.