spivurno
2/21/2017 - 2:11 AM

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)

/**
 * 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 + ')' );
    }
} );