Last active
March 3, 2020 22:52
-
-
Save interactiveRob/e2f53ce90e1f7990a4a3859746ae87f9 to your computer and use it in GitHub Desktop.
Get a list of ACF names from wordpress post editor console
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
var names = []; | |
document.querySelectorAll('.acf-field').forEach(function(field){ | |
names.push( field.dataset.name ); | |
}); | |
console.log("LIST START\n\n"+ names.join('\n')+"\n\nLIST END"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this function to get a list of ACF field names to use for your PHP after they have been created.