Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/8408acc738369d9c9775c79372507f78 to your computer and use it in GitHub Desktop.
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)
/**
* 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