Last active
November 28, 2018 20:45
-
-
Save jonwaldstein/df2498be0b4755556d23acb3ba07dd40 to your computer and use it in GitHub Desktop.
ACF Field Name Generator
This file contains hidden or 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
var fieldNames = document.querySelectorAll('.li-field-name'); | |
var fieldNameList = []; | |
fieldNames.forEach(function(name){ | |
fieldNameList.push("$"+name.textContent.replace(/\s+/g, '')+" "+"="+" "+"get_field("+"'"+name.textContent.replace(/\s+/g, '')+"'"+");"); | |
}); | |
console.log(fieldNameList.join('\r\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment