Last active
July 23, 2017 11:26
-
-
Save spivurno/8408acc738369d9c9775c79372507f78 to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Append Admin Label to Field Settings Toolbar (via Browser 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
/** | |
* Gravity Wiz // Gravity Forms // Append Admin Label to Field Settings Toolbar (via Browser Console) | |
* | |
* Provides a simple function for appending the field's admin label to the field settings toolbar. | |
* | |
* @version 1.0 | |
* @author David Smith <david@gravitywiz.com> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/ | |
* | |
* Instructions: | |
* | |
* 1. Open the desired form in the Form Editor. | |
* | |
* 2. Open your Browser Console | |
* | |
* Chrome: https://developer.chrome.com/devtools/docs/console | |
* Firefox: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console | |
* IE: https://msdn.microsoft.com/en-us/library/gg589530(v=vs.85).aspx | |
* | |
* 3. Copy and paste this snippet into the console. | |
* | |
* All done. You should see something like this [screenshot](http://gwiz.io/2kFVWYO). | |
* | |
*/ | |
jQuery( '.gfield' ).each( function() { | |
var fieldId = jQuery( this ).attr( 'id' ).split( '_' )[1], | |
field = GetFieldById( fieldId ); | |
if( field.adminLabel ) { | |
jQuery( this ).find( '.gfield_admin_header_title' ).append( ' (' + field.adminLabel + ')' ); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment