LLMS_User_Permissions::handle_caps( array $allcaps, array $cap, array $args )

Custom capability checks for LifterLMS things


Description Description


Parameters Parameters

$allcaps

(array) (Required) All the capabilities of the user

$cap

(array) (Required) [0] Required capability

$args

(array) (Required) [0] Requested capability [1] User ID [2] Associated object ID


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.user.permissions.php

	public function handle_caps( $allcaps, $cap, $args ) {

		foreach ( array( 'courses', 'lessons', 'sections', 'quizzes', 'questions', 'memberships' ) as $cpt ) {
			// allow any instructor to edit courses
			// they're attached to
			if ( in_array( sprintf( 'edit_others_%s', $cpt ), $cap ) ) {
				$allcaps = $this->edit_others_lms_content( $allcaps, $cap, $args );
			}
		}

		return $allcaps;

	}

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.