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.


Top ↑

Return Return

(array)


Top ↑

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;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.12.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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