Last active
January 9, 2019 08:13
-
-
Save httpstersk/70f9b17cab3bc50fce2db151222c737d to your computer and use it in GitHub Desktop.
➋ Parse the slug from the permalink (returns null if the post is not viewable)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { select } = wp.data; | |
const { getPermalinkParts } = select( 'core/editor' ); | |
const slug = getPermalinkParts().postName; | |
console.log(slug); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment