LLMS_Beaver_Builder::mod_page_restrictions( array $results, int $post_id )

Bypass restriction checks for courses and memberships when the builder is active.


Description Description

Allows the builder to use custom LifterLMS visibility settings when a student is not enrolled.


Top ↑

Parameters Parameters

$results

(array) (Required) Restriction results data.

$post_id

(int) (Required) Current post id.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-llms-beaver-builder.php

	public function mod_page_restrictions( $results, $post_id ) {

		if (
			FLBuilderModel::is_builder_enabled() &&
			$results['is_restricted'] &&
			in_array( get_post_type( $post_id ), array( 'course', 'llms_membership' ), true )
		) {
			$results['is_restricted'] = false;
			$results['reason']        = 'bb-lab';
		}

		return $results;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Use in_array with strict comparison.
1.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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