update_item_permissions_check example



    /** * Checks if a given request can perform post processing on an attachment. * * @since 5.3.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */
    public function post_process_item_permissions_check( $request ) {
        return $this->update_item_permissions_check( $request );
    }

    /** * Checks if a given request has access to editing media. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */
    public function edit_media_item_permissions_check( $request ) {
        
/** * Checks if a given request has access to update the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */
    public function update_current_item_permissions_check( $request ) {
        $request['id'] = get_current_user_id();

        return $this->update_item_permissions_check( $request );
    }

    /** * Updates the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */
    public function update_current_item( $request ) {
        
public function create_item_permissions_check( $request ) {
        $id = $request->get_param( 'id' );

        if ( empty( $id ) ) {
            return new WP_Error(
                'rest_post_invalid_id',
                __( 'Invalid item ID.' ),
                array( 'status' => 404 )
            );
        }

        return $this->parent_controller->update_item_permissions_check( $request );
    }

    /** * Creates, updates or deletes an autosave revision. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */
    public function create_item( $request ) {

        
Home | Imprint | This part of the site doesn't use cookies.