Weird failed request
-
Hello. Below there is a simplified version of the concept I’m trying to make work.
In a post, I’m manually inserting this core Image block:
<!-- wp:image {"id":7} --> <figure class="wp-block-image"><img src="[picsum]" alt="ASD" class="wp-image-7"/></figure> <!-- /wp:image -->
As you see, there is shortcode for the src attribute of the image, so here is the shortcode callback.
add_shortcode( 'picsum', 'picsum_func' ); function picsum_func( $atts ) { return "https://picsum.photos/id/237/200/300"; }
Simple, right?
When I open this post on the frontend it renders the image properly. Also, when I open the post on the editor, it renders no image for the image block, but the block is surely there.
What is weird, is that in my console log there is this error
GET https://example.local/wp-admin/[picsum] 404 (Not Found)
, which I cannot debug because the stack trace is not helpful, at least not to me. This happens with both the latest WP and the editor that it carries and with the latest version from the GB repo.Can you help me identify what the problem is and how can I prevent this? Where is this request coming from?
- The topic ‘Weird failed request’ is closed to new replies.