LLMS_Integration_Buddypress::restriction_checks( array $results )
Allows restricting of BP Directory Pages for Activity and Members via LifterLMS membership restrictions.
Parameters Parameters
- $results
-
(array) (Required) Array of restriction results.
Return Return
(array)
Source Source
File: includes/integrations/class.llms.integration.buddypress.php
public function restriction_checks( $results ) { // Only check directories. if ( ! bp_is_directory() ) { return $results; } $post_id = null; // Activity. if ( bp_is_activity_component() ) { $post_id = bp_core_get_directory_page_id( 'activity' ); } elseif ( bp_is_members_component() ) { $post_id = bp_core_get_directory_page_id( 'members' ); } elseif ( bp_is_groups_component() ) { $post_id = bp_core_get_directory_page_id( 'groups' ); } if ( $post_id ) { $restriction_id = llms_is_post_restricted_by_membership( $post_id, get_current_user_id() ); if ( $restriction_id ) { $results['content_id'] = $post_id; $results['restriction_id'] = $restriction_id; $results['reason'] = 'membership'; } } return $results; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.12.0 | Introduced. |