LLMS_Blocks_Post_Instructors::update_callback( string $value, WP_Post $object, string $key )
Update instructor information for a given object.
Description Description
Parameters Parameters
- $value
-
(string) (Required) Instructor data to add to the object (JSON).
- $object
-
(WP_Post) (Required) WP_Post object.
- $key
-
(string) (Required) name of the field.
Return Return
(null|WP_Error)
Source Source
File: vendor/lifterlms/lifterlms-blocks/includes/class-llms-blocks-post-instructors.php
public function update_callback( $value, $object, $key ) { if ( ! current_user_can( 'edit_post', $object->ID ) ) { return new WP_Error( 'rest_cannot_update', __( 'Sorry, you are not allowed to edit the object instructors.', 'lifterlms' ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } $obj = llms_get_post( $object ); if ( $obj ) { $obj->instructors()->set_instructors( $value ); } return null; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: