'GET', 'callback' => [$this, 'handle_editor_pull'], 'permission_callback' => function() { return current_user_can('edit_posts'); } ]); } public function handle_editor_pull(\WP_REST_Request $request) { $transient_key = 'aiutoma_editor_push_' . get_current_user_id(); $blocks = get_transient($transient_key); if ($blocks) { delete_transient($transient_key); return rest_ensure_response(['success' => true, 'blocks' => $blocks]); } return rest_ensure_response(['success' => false]); } }