$body Request body from Request_Builder::build_body(). * @return void */ public static function record( array $body ): void { $encoded = wp_json_encode( $body ); self::$request_json = is_string( $encoded ) ? $encoded : null; } /** * Return the stashed request body and clear the slot (consume-once). * * @return string|null JSON request body, or null when nothing is stashed. */ public static function consume(): ?string { $json = self::$request_json; self::$request_json = null; return $json; } /** * Clear the stash (tests / defensive teardown). * * @return void */ public static function clear(): void { self::$request_json = null; } }