Skip to content

Instantly share code, notes, and snippets.

@mohdsayed
Last active August 10, 2016 18:00
Show Gist options
  • Save mohdsayed/cf28338a9ceca11a913d6b3ad20d3db5 to your computer and use it in GitHub Desktop.
Save mohdsayed/cf28338a9ceca11a913d6b3ad20d3db5 to your computer and use it in GitHub Desktop.
Convert setting id to class
var settingId = '[post][id]'
var className = settingId.replace( /]/g, '' ).split( '[' ).filter(Boolean).join( '-' );
// Makes it post-id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment