WP_Users_List_Table::ajax_user_can() WordPress Method

The WP_Users_List_Table::ajax_user_can() method is used to check whether the current user has the required capability to perform an AJAX request. This is a utility function that is used to check whether the current user has the required capability to perform an AJAX request. This is typically used to check whether the user has the 'edit_users' capability, which is required for most AJAX actions related to users. This function is called before an AJAX request is processed, and if the user does not have the required capability, the request will fail.

WP_Users_List_Table::ajax_user_can() #

Check the current user’s permissions.


Return

(bool)


Top ↑

Source

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

	public function ajax_user_can() {
		if ( $this->is_site_users ) {
			return current_user_can( 'manage_sites' );
		} else {
			return current_user_can( 'list_users' );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.