Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Roles::get_wp_caps( string $role )

Retrieve the core WP capabilities for a give role


Parameters Parameters

$role

(string) (Required) Name of the role.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.roles.php

	private static function get_wp_caps( $role ) {

		$caps = array(
			'read' => true,
		);

		switch ( $role ) {

			case 'instructor':
				$add = array(
					'create_users'  => true,
					'edit_users'    => true,
					'promote_users' => true,
					'list_users'    => true,

					'read'          => true,
					'upload_files'  => true,

					/**
					 * See WP Core issue(s)
					 *
					 * @link https://core.trac.wordpress.org/ticket/22895
					 * @link https://core.trac.wordpress.org/ticket/16808
					 */
					'edit_posts'    => true,
				);

				break;

			case 'instructors_assistant':
				$add = array(
					'read'         => true,
					'upload_files' => true,

					/**
					 * See WP Core issue(s)
					 *
					 * @link https://core.trac.wordpress.org/ticket/22895
					 * @link https://core.trac.wordpress.org/ticket/16808
					 */
					'edit_posts'   => true,
				);

				break;

			case 'lms_manager':
				$add = array(
					'read_private_pages'     => true,
					'read_private_posts'     => true,
					'edit_posts'             => true,
					'edit_pages'             => true,
					'edit_published_posts'   => true,
					'edit_published_pages'   => true,
					'edit_private_pages'     => true,
					'edit_private_posts'     => true,
					'edit_others_posts'      => true,
					'edit_others_pages'      => true,
					'publish_posts'          => true,
					'publish_pages'          => true,
					'delete_posts'           => true,
					'delete_pages'           => true,
					'delete_private_pages'   => true,
					'delete_private_posts'   => true,
					'delete_published_pages' => true,
					'delete_published_posts' => true,
					'delete_others_posts'    => true,
					'delete_others_pages'    => true,
					'manage_categories'      => true,
					'manage_links'           => true,
					'moderate_comments'      => true,
					'upload_files'           => true,
					'export'                 => true,
					'import'                 => true,

					'edit_users'             => true,
					'create_users'           => true,
					'list_users'             => true,
					'promote_users'          => true,
					'delete_users'           => true,
				);

				break;

			default:
				$add = array();

		}

		return apply_filters( 'llms_get_' . $role . '_wp_caps', array_merge( $add, $caps ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.34.0 Add the list_users capability to instructors.
3.13.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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