public/wordpress/wp-content/plugins/wp-courseware/includes/core/roles.php
/**
	 * Change the dropdown of editable roles when adding a new user.
	 *
	 * @since 4.3.0
	 *
	 * @param array $roles The editable roles.
	 *
	 * @return array $roles The modified editable roles.
	 */
Change the dropdown of editable roles when adding a new user.

@param array $roles The editable roles.

@return array $roles The modified editable roles.
Change the dropdown of editable roles when adding a new user . @param array $roles The editable roles . @return array $roles The modified editable roles .
public function editable_roles( $roles ) {
		global $pagenow;
		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
			return $roles;
		}
		if ( current_user_can( 'manage_wpcw_settings' ) ) {
			return $roles;
		}
		if ( 'user-new.php' !== $pagenow ) {
			return $roles;
		}
		$allowed_roles = array( 'subscriber' );
		foreach ( $roles as $role_key => $role ) {
			if ( ! in_array( $role_key, $allowed_roles ) ) {
				unset( $roles[ $role_key ] );
			}
		}
		return $roles;
	}
public function editable_roles ( $ roles ) { global $ pagenow ; if ( defined ( 'DOING_AJAX' ) && DOING_AJAX ) { return $ roles ; } if ( current_user_can ( 'manage_wpcw_settings' ) ) { return $ roles ; } if ( 'user-new.php' !== $ pagenow ) { return $ roles ; } $ allowed_roles = array ( 'subscriber' ) ; foreach ( $ roles as $ role_key => $ role ) { if ( ! in_array ( $ role_key , $ allowed_roles ) ) { unset ( $ roles [ $ role_key ] ) ; } } return $ roles ; }
Change the dropdown of editable roles when adding a new user.
Change the dropdown of editable roles when adding a new user .
// Check for permissions. // Check screen // Allowed Roles