wearerequired / h2push

Sends Link headers to bring HTTP/2 Server Push for scripts and styles to WordPress.
GNU General Public License v2.0
5 stars 0 forks source link

Incompatible with `/wp/v2/widget-types/:id/render` #28

Closed grappler closed 2 years ago

grappler commented 2 years ago

The REST API Endpoint /wp/v2/widget-types/<widget>/render returns an iframe template which uses wp_head();

https://github.com/WordPress/wordpress-develop/blob/6.0/src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php#L613-L655

As h2push hooks into wp_head, which causes the whole header to be added before the JSON output.