Ok, I found the issue.
After uploading the image programmatically I was calling wp_update_attachment_metadata
to set the file
metadata.
Apparently, that was creating this issue and srcset
was not being set.
I have no idea why this is related though 🙂
Related Posts:
- Is there a better way to implement responsive images than what WordPress uses by default?
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- check if Gutenberg is currently in use
- How to use PanelColorSettings in custom Gutenberg block?
- How to implement add_image_size in a plugin
- Adding pre-publish checks with Gutenberg
- Managing two editable fields in gutenberg
- How to make repeated component/block in Gutenberg
- How to catch images with blank dimensions?
- How to save block attributes when the output doesn’t change
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- lodash dependency in a Gutenberg plugin
- Having Problem On Getting WP Post Gallery Images URL
- Set first image (external) as featured image / thumbnail
- creating elements/innerblocks via rangecontrol
- What’s the Right Way to get and save remote data for a Gutenberg block?
- How to get an image transferred via FTP or script to appear in Media Manager?
- How to Parse an Array of Elements in Gutenberg Block
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- Using the component outside the editor. select(‘core’) is null
- Gutenberg is there a way to know if the current block is reusable?
- How to disable “Transform to” option in Gutenberg custom blocks
- Add media and attach images to pages
- How to allow core Gutenberg blocks selection only when you are inside a custom inner block
- Saving data from block editor to the database
- Make a list with header and subtext in Gutenberg blocks
- Gutenberg – What is the best way to save/update post meta?
- Save image as featured image
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Hook to get image filename when it is uploaded
- Resizing Images for a Gallery-Plugin?
- How insert negative values in Gutenberg box-control
- Initial help with official “create a block” tutorial
- Are block templates incompatible with serialize_blocks?
- How do I dynamically render an InnerBlock inside a dynamic block?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- Gutenberg Block showing invalid content on edit
- Gutenberg blocks not getting styled on back end
- Run code once when block is created
- Best way to save custom css for an block
- How can I listen to events in Gutenberg block?
- It’s possible to passing a ref to FormTokenField from parent component using forwardRef?
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- WP Gutenberg Blocks – How to limit first/root blocks
- Creating a custom Gutenberg block with columns
- JSX in WordPress Plugin Development
- ResizableBox with RangeControl not working
- How to Upload Images From a Folder (Not WP_Uploads)
- Gutenberg: import dependency or assign from global variable?
- Upload multiple images and insert them into custom html code
- Gutenberg table block with Bootstrap .table class
- How to add a gradient component to a custom block
- Uploaded attachment not set as featured image
- Catching Gutenberg sidebar switch event
- Hook after attachment added and cropped
- Use npm and wp-env to make production bundle
- How to add template colors to custom block options in WordPress Gutenberg editor sidebar?
- how to change image of jquery slider plugin
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- How to properly package a block plugin
- Setting global block attribute value
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- Cleaning a filename after image sideloading a url that contains `%20`
- How to list all images used on a specific page?
- Screenshots on plugin page taken old [closed]
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Modify custom block plugin without losing content
- Custom Block Not Shown in Block Inserter
- How to override supports of innerBlocks?
- var(–text-color) in style.scss works once but not twitch
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- Gutenberg block breaks when showing new data
- What happens/fires when you select a block in the editor?
- How to re-render inspector controls?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Where to save Gutenberg plugin data?
- Gutenberg component in a plugin admin
- WordPress discards PNG file when uploading plugin file
- Add custom html classes to gutenberg wrapper
- Replace the WordPress Media Library Uploader
- How to create save function for custom Gutenberg style block?
- Caption Shortcode: what filter to change the image size?
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- Custom plugin not appearing
- Gutenberg’s Popover component position relative to the focused element
- Undo operation not working in Rich text [Gutenberg]
- Render raw html in Gutenberg block
- Build a dynamic block using the default attributes
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- REST API error in block editor for custom templates
- Reinitiate Gutenburg’s blocks using javascript
- Remove Gutenberg Buttons Block