LLMS_REST_Posts_Controller::llms_post_class_from_post_type()

Get the llms post model class from the controller post type.


Return Return

(string|bool) The llms post model class name if it exists or FALSE if it doesn't.


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-posts-controller.php

		if ( empty( $object->get( 'password' ) ) ) {
			// No filter required.
			return false;
		}

		// Edit context always gets access to password-protected posts.
		if ( 'edit' === $request['context'] ) {
			return true;
		}

		// No password, no auth.
		if ( empty( $request['password'] ) ) {
			return false;
		}

		// Double-check the request password.
		return hash_equals( $object->get( 'password' ), $request['password'] );
	}

	/**


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.9 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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