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)
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' ); } }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |