Fix for gutenberg
-
Hi there,
This plugin didn’t work inside gutenberg editor for me. I found it didn’t create resizefly urls when creating content with images. On the rendered page it worked. Inside the editor it gave a 404 on images.
I fixed this by adding filters to run() in src/Upload/Filter.php:
// add resizefly url before loaded into gutenberg add_filter( 'rest_prepare_page', [$this, 'urlInRestResponse'], 10, 1 ); add_filter( 'rest_prepare_post', [$this, 'urlInRestResponse'], 10, 1 );
And creating this function in Filter.php:
/** * @param WP_REST_Response $res * * @return WP_REST_Response */ public function urlInRestResponse($res) { if (!empty($res->data['content']['raw'])) { $res->data['content']['raw'] = $this->urlInHtml($res->data['content']['raw']); } return $res; }
Could you merge this or a similar fix?
Thanks,
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Fix for gutenberg’ is closed to new replies.