How To Update Featured Image Programatically
-
Hello fellow WordPress enthusiasts,
I thought I’d be able to update the featured image using this code…
wp.data.dispatch( 'core/editor' ).editPost( { featured_media: 10 } );
However, I get an error:
Uncaught (in promise) Error: The entity being edited (postType, undefined) does not have a loaded config.
What needs to be changed?
Regards,
Jack
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How To Update Featured Image Programatically’ is closed to new replies.