LLMS_Query::maybe_404_certificate()

Serve a 404 for certificates that are not viewable by the current user


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.query.php

	public function maybe_404_certificate() {

		if ( 'llms_my_certificate' === get_post_type() ) {
			$cert = new LLMS_User_Certificate( get_the_ID() );
			if ( ! $cert->can_user_view() ) {

				global $wp_query;
				$wp_query->set_404();
				status_header( 404 );
				nocache_headers();

			}
		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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