Noptin_Page::filter_page_template( $template )


Source Source

File: includes/class-noptin-page.php

	public function filter_page_template( $template ) {

		if ( is_noptin_actions_page() ) {

			// No action specified, redirect back home.
			$action = $this->get_request_action();
			if ( empty( $action ) ) {
				wp_redirect( get_home_url() );
				exit;
			}

			/*
			 * Site admins are allowed to use custom pages
			 * to render the actions page.
			 */
			$custom_page = get_noptin_option( "pages_{$action}_page" );

			// They can also set the page as a URL param.
			if ( isset( $_GET['rdt'] ) ) {
				$custom_page = esc_url( urldecode( $_GET['rdt'] ) );
			}

			// Provide a way to filter the page.
			$custom_page = apply_filters( 'noptin_action_page_redirect', $custom_page, $action, $this );
			do_action( "noptin_pre_page_$action", $custom_page );

			$template = locate_noptin_template( 'actions-page.php' );
			if ( isset( $_GET['nte'] ) ) {
				$template = locate_noptin_template( 'actions-page-empty.php' );
			}

			$template = apply_filters( 'noptin_actions_page_template', $template );

			include $template;
			exit;
		}

		return $template;

	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation