LLMS_Template_Loader::maybe_redirect_to_sales_page()
Handle sales page redirects for courses & memberships
Return Return
(void)
Source Source
File: includes/class.llms.template.loader.php
* @return void */ public function maybe_redirect_to_sales_page() { // Only proceed for courses and memberships. if ( ! in_array( get_post_type(), array( 'course', 'llms_membership' ), true ) ) { return; } $page_restricted = llms_page_restricted( get_the_id() ); // Only proceed if the page isn't restricted. if ( ! $page_restricted['is_restricted'] ) { return; } /** @var LLMS_Trait_Sales_Page $post */ $post = llms_get_post( get_the_ID() ); if ( ! $post->has_sales_page_redirect() ) { return; } llms_redirect_and_exit( llms_notice_count() ? add_query_arg( array( 'llms_print_notices' => 1, ), $post->get_sales_page_url() ) : $post->get_sales_page_url(), array( 'safe' => false, ) );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.37.2 | Flag to print notices, if there are, when landing on the redirected sales page. |
3.20.0 | Introduced. |