Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_REST_Access_Plans_Controller::block_request_when_access_plan_limit_reached( WP_REST_Request $request )

Block request when the access plan limit per product is reached.


Parameters Parameters

$request

(WP_REST_Request) (Required) Full details about the request.


Top ↑

Return Return

(true|WP_Error)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-access-plans-controller.php

			if ( current_user_can( $product_post_type_object->cap->edit_post, $product_id ) ) {
				$has_permissions = true;
			}
		}

		return $has_permissions;
	}

	/**
	 * Allow request when the access plan limit per product is not reached.
	 *
	 * @since 1.0.0-beta.20
	 * @since 1.0.0-beta-24 Made sure we can update an access plan of a product even if its access plan limit has already been reached.
	 *
	 * @param WP_REST_Request $request Full details about the request.
	 * @return true|WP_Error
	 */
	private function allow_request_when_access_plan_limit_not_reached( $request ) {

		// `id` required on "reading/updating", `post_id` required on "creating".
		if ( empty( $request['id'] ) && empty( $request['post_id'] ) ) {

Top ↑

User Contributed Notes User Contributed Notes

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