# convertkit/2.0.1/resources/backend/js/quick-edit.js

Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages, version 2.0.1. 56 lines.

- Page: https://pluginprobe.com/plugins/convertkit/2.0.1/code/resources/backend/js/quick-edit.js
- Raw: https://pluginprobe.com/plugins/convertkit/2.0.1/raw/resources/backend/js/quick-edit.js
- Modified: 2022-07-14T12:23:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/convertkit/2.0.1/code/resources/backend/js/quick-edit.js#L10-L20`.

```javascript
/**
 * Quick Edit
 *
 * @package ConvertKit
 * @author ConvertKit
 */

/**
 * Copies Quick Edit fields into WordPress' #inline-edit table row on load.
 *
 * Populates Quick Edit fields for this Plugin with the values output
 * in the `add_inline_data` WordPress action when the user clicks
 * a Quick Edit link in a Post, Page or Custom Post Type WP_List_Table.
 *
 * WordPress' built in Quick Edit functionality does not do this automatically
 * for Plugins that register settings, which is why we have this code here.
 *
 * @since 	1.9.8.0
 */
jQuery( document ).ready(
	function( $ ) {

		// Move Quick Edit fields from footer into the hidden inline-edit table row.
		$( 'tr#inline-edit .inline-edit-wrapper fieldset.inline-edit-col-left' ).first().append( $( '#convertkit-quick-edit' ) );

		// Show the Quick Edit fields, as they are now contained in the inline-edit row which WordPress will show/hide as necessary.
		$( '#convertkit-quick-edit' ).show();

		var convertKitInlineEditPost = inlineEditPost.edit;

		// Extend WordPress' inline edit function to load the Plugin's Quick Edit fields.
		inlineEditPost.edit = function( id ) {

			// Merge arguments from original function.
			convertKitInlineEditPost.apply( this, arguments );

			// Get Post ID.
			if ( typeof( id ) === 'object' ) {
				id = parseInt( this.getId( id ) );
			}

			// Iterate through any ConvertKit inline data, assigning values to Quick Edit fields.
			$( '.convertkit', $( '#inline_' + id ) ).each(
				function() {

					// Assign the setting's value to the setting's Quick Edit field.
					$( '#convertkit-quick-edit select[name="wp-convertkit[' + $( this ).data( 'setting' ) + ']"]' ).val( $( this ).data( 'value' ) );

				}
			);

		}

	}
);

```
