404 ) ); } // Check if the user has permission to edit the post. if ( ! \current_user_can( 'edit_post', $post->ID ) ) { return new WP_Error( 'activitypub_permission_denied', __( 'You do not have permission to edit this post.', 'activitypub' ), array( 'status' => 403 ) ); } // Update the post content. $post_data = array( 'ID' => $post->ID, 'post_content' => $activity['object']['content'], ); wp_update_post( $post_data ); } }