WP_MS_Users_List_Table::get_views

Advertisement

Syntax Syntax

WP_MS_Users_List_Table::get_views()

Return Return

(array)

Source Source

File: wp-admin/includes/class-wp-ms-users-list-table.php

	protected function get_views() {
		global $role;

		$total_users  = get_user_count();
		$super_admins = get_super_admins();
		$total_admins = count( $super_admins );

		$current_link_attributes = 'super' !== $role ? ' class="current" aria-current="page"' : '';
		$role_links              = array();
		$role_links['all']       = sprintf(
			'<a href="%s"%s>%s</a>',
			network_admin_url( 'users.php' ),
			$current_link_attributes,
			sprintf(
				/* translators: Number of users. */
				_nx(
					'All <span class="count">(%s)</span>',
					'All <span class="count">(%s)</span>',
					$total_users,
					'users'
				),
				number_format_i18n( $total_users )
			)
		);
		$current_link_attributes = 'super' === $role ? ' class="current" aria-current="page"' : '';
		$role_links['super']     = sprintf(
			'<a href="%s"%s>%s</a>',
			network_admin_url( 'users.php?role=super' ),
			$current_link_attributes,
			sprintf(
				/* translators: Number of users. */
				_n(
					'Super Admin <span class="count">(%s)</span>',
					'Super Admins <span class="count">(%s)</span>',
					$total_admins
				),
				number_format_i18n( $total_admins )
			)
		);

		return $role_links;
	}

Advertisement

Advertisement

Leave a Reply