LLMS_Integration_BBPress::restriction_checks_memberships( array $results )
Check membership restrictions for Topics and Forum Archive pages
Parameters Parameters
- $results
-
(array) (Required) Array of restriction results.
Return Return
(array)
Source Source
File: includes/integrations/class.llms.integration.bbpress.php
public function restriction_checks_memberships( $results ) {
$post_id = null;
// Forum archive, grab the page (if set).
if ( bbp_is_forum_archive() ) {
$page = bbp_get_page_by_path( bbp_get_root_slug() );
$post_id = ( $page && $page->ID ) ? $page->ID : null;
$reason = 'membership';
} elseif ( bbp_is_topic( $results['content_id'] ) ) {
$post_id = bbp_get_topic_forum_id( $results['content_id'] );
$reason = 'membership';
}
if ( $post_id ) {
$restriction_id = llms_is_post_restricted_by_membership( $post_id, get_current_user_id() );
if ( $restriction_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. |