WC_Admin_API_Keys_Table_List::column_user( array $key )

Return user column.


Description Description


Parameters Parameters

$key

(Required) Key data.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/admin/class-wc-admin-api-keys-table-list.php

	public function column_user( $key ) {
		$user = get_user_by( 'id', $key['user_id'] );

		if ( ! $user ) {
			return '';
		}

		if ( current_user_can( 'edit_user', $user->ID ) ) {
			return '<a href="' . esc_url( add_query_arg( array( 'user_id' => $user->ID ), admin_url( 'user-edit.php' ) ) ) . '">' . esc_html( $user->display_name ) . '</a>';
		}

		return esc_html( $user->display_name );
	}

Top ↑

User Contributed Notes User Contributed Notes

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