LLMS_Roles::remove_roles()

Uninstall custom roles and remove custom caps from default WP roles


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.roles.php

	public static function remove_roles() {

		if ( ! class_exists( 'WP_Roles' ) ) {
			return;
		}

		$wp_roles = wp_roles();

		// Delete all our custom roles.
		foreach ( array_keys( self::get_roles() ) as $role ) {
			$wp_roles->remove_role( $role );
		}

		// Remove custom caps from the WP core admin role.
		self::update_caps( $wp_roles->get_role( 'administrator' ), 'remove', array( 'wp' ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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