LLMS_REST_Posts_Controller::check_update_permission( LLMS_Post_Model $object = null )

Checks if an llms post can be edited.

Parameters Parameters


(LLMS_Post_Model) (Optional) The LLMS_Post_model object.

Default value: null

Top ↑

Return Return

(bool) Whether the post can be edited.

Top ↑

Source Source

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

	protected function check_update_permission( $object = null ) {

		$post_type = get_post_type_object( $this->post_type );
		return is_null( $object ) ? current_user_can( $post_type->cap->edit_posts ) : current_user_can( $post_type->cap->edit_post, $object->get( 'id' ) );


Top ↑

Changelog Changelog

Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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