Last active
April 4, 2020 17:10
-
-
Save gsarig/5052928650b69dadf7febdbcb6ab14c7 to your computer and use it in GitHub Desktop.
A Greasemonkey script to display ACF field names next to their labels on WordPress Admin (read more: https://www.gsarigiannidis.gr/quickly-view-an-acf-field-s-name-on-wordpress-admin/)
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
// ==UserScript== | |
// @name Show ACF field names in WP Admin | |
// @match http://*/wp-admin/* | |
// @match https://*/wp-admin/* | |
// @match http://*/*/wp-admin/* | |
// @match https://*/*/wp-admin/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var field = document.querySelectorAll('.acf-field'), | |
i; | |
if(field.length) { | |
for (i = 0; i < field.length; i++) { | |
var thisField = field[i], | |
fieldName = thisField.dataset.name, | |
fieldLabel = document.createElement('span'); | |
fieldLabel.style.cssText = 'color:#999;font-weight:normal;'; | |
fieldLabel.innerHTML = ' [' + fieldName + ']'; | |
thisField.querySelector('.acf-label label').appendChild(fieldLabel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment