LLMS_Integration_BBPress::handle_course_forum_restriction( array $restriction )

Handle course forum restrictions


Description Description

Add a notice and redirect to the course


Top ↑

Parameters Parameters

$restriction

(array) (Required) Restriction Results from llms_page_restricted().


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/integrations/class.llms.integration.bbpress.php

	public function handle_course_forum_restriction( $restriction ) {

		/**
		 * Customize the restriction notice message displayed when a forum is restricted to a course.
		 *
		 * @since 3.37.11
		 *
		 * @param string $msg         Default message.
		 * @param array  $restriction Results from `llms_page_restricted()`.
		 */
		$msg = apply_filters( 'llms_bbp_course_forum_restriction_msg', __( 'You must be enrolled in this course to access the course forum.', 'lifterlms' ), $restriction );

		llms_add_notice( $msg, 'error' );
		llms_redirect_and_exit( get_permalink( $restriction['restriction_id'] ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.37.11 Use llms_redirect_and_exit() in favor of wp_redirect().
3.13.0 Unknown.
3.12.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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