LLMS_Roles::install()

Install custom roles and related capabilities


Description Description

Called from LLMS_Install during installation and upgrades.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.roles.php

	public static function install() {

		global $wp_roles;

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

		$roles                  = self::get_roles();
		$roles['administrator'] = __( 'Administrator', 'lifterlms' );

		$wp_roles = wp_roles();

		foreach ( $roles as $role => $name ) {

			$role_obj = $wp_roles->get_role( $role );

			if ( ! $role_obj ) {
				$role_obj = $wp_roles->add_role( $role, $name );
			}

			self::update_caps( $role_obj, 'add' );

		}

	}


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.