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.
Parameters Parameters
- $results
-
(array) (Required) Restriction results data.
- $post_id
-
(int) (Required) Current post id.
Return Return
(array)
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.7.0 | Use in_array with strict comparison. |
| 1.3.0 | Introduced. |