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
- How can I add an image upload field directly to a custom write panel?
- check if Gutenberg is currently in use
- How to use PanelColorSettings in custom Gutenberg block?
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- 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
- Using Primary Color in Plugin Block
- 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
- How to find attachment ID for first image in a post
- Having Problem On Getting WP Post Gallery Images URL
- Create Element From Dynamic HTML String [closed]
- Set first image (external) as featured image / thumbnail
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- Hook event for upload image in the menu
- creating elements/innerblocks via rangecontrol
- What’s the Right Way to get and save remote data for a Gutenberg block?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- Looking for callback function after Gutenberg is rendered?
- 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
- Gutenberg registerFormatType with Multiple Classes
- Saving data from block editor to the database
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- 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
- How do you render_callback for register_block_type to a method in another class?
- How to create multiple Gutenberg blocks in one plugin
- How to get color name in PanelColorSettings in custom Gutenberg block?
- 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
- WordPress Block Development – trouble importing from @wordpress/icons
- Gutenberg blocks not getting styled on back end
- How to serve different thumbnails/images depending on users browser/platform
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- How to setAttributes in Gutenberg block?
- How to access noticeOperations from withNotices
- Run code once when block is created
- Best way to save custom css for an block
- How to prevent UNDO on guternberg block editor
- How to insert text at the current cursor position in Gutenberg?
- How to override gutenberg paragraph block edit property
- How can I listen to events in Gutenberg block?
- It’s possible to passing a ref to FormTokenField from parent component using forwardRef?
- Do I have to worry about useState causing a re-render?
- 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
- How to get boolean value from register_meta properly?
- JSX in WordPress Plugin Development
- ResizableBox with RangeControl not working
- How can I get the selected string when using a toolbar button in Gutenberg?
- How to Upload Images From a Folder (Not WP_Uploads)
- jQuery selectors for editor elements safe to use?
- There is a problem in the gutenberg block I developed. Problem is with withInstanceId
- Gutenberg: import dependency or assign from global variable?
- How to export post meta with images in wordpress
- Get attachments from a post
- Putting a resized image into media library with wp_get_image_editor(
- Display list of uploaded images, filtered by user under a specific user group
- Upload multiple images and insert them into custom html code
- Gutenberg table block with Bootstrap .table class
- How to control an elements classes from multiple Gutenberg sidebar controls?
- How to add a gradient component to a custom block
- How to only load css for used blocks on frontend
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Which is the better way to store images for the plugin?
- Uploaded attachment not set as featured image
- How do I change the image from the default mysteryman in the WP Profile page
- Catching Gutenberg sidebar switch event
- Hook after attachment added and cropped
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Use npm and wp-env to make production bundle
- Conditional Generation of Image Sizes using add_image_size
- How to add template colors to custom block options in WordPress Gutenberg editor sidebar?