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.
Contents
Parameters Parameters
- $request
-
(WP_REST_Request) (Required) Full details about the request.
Return Return
(true|WP_Error)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-access-plans-controller.php
} $product_id = isset( $request['id'] ) /* not creation */ ? $this->get_object( (int) $request['id'] )->get( 'product_id' ) : (int) $request['post_id']; $product_post_type_object = get_post_type_object( get_post_type( $product_id ) ); 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
Expand full source code Collapse full source code View on GitHub