Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
➎ Get the url of the current featured image
const { select } =;
const { getMedia } = select( 'core' );
const { getEditedPostAttribute } = select( 'core/editor' );
const mediaId = getEditedPostAttribute('featured_media');
const mediaUrl = getMedia(mediaId).source_url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.