LLMS_Roles::install()

Install custom roles and related capabilities Called from LLMS_Install during installation and upgrades


Description Description


Return Return

([type]) [description]


Top ↑

Source Source

File: includes/class.llms.roles.php

	public static function install() {

		global $wp_roles;

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

		// self::remove_roles(); // @todo remove, this is here for dev reasons only

		$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.





Permalink: