# speechkit/4.0.0/src/Component/Posts/BulkEdit/js/bulk-edit.js

BeyondWords – AI audio for publishers, version 4.0.0. 40 lines.

- Page: https://pluginprobe.com/plugins/speechkit/4.0.0/code/src/Component/Posts/BulkEdit/js/bulk-edit.js
- Raw: https://pluginprobe.com/plugins/speechkit/4.0.0/raw/src/Component/Posts/BulkEdit/js/bulk-edit.js
- Modified: 2023-07-26T14:25:00+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/speechkit/4.0.0/code/src/Component/Posts/BulkEdit/js/bulk-edit.js#L10-L20`.

```javascript
/* global jQuery, inlineEditPost */

jQuery( document ).ready( function ( $ ) {
	// it is a copy of the inline edit function
	const wpInlineEditFunction = inlineEditPost.edit;
	// we overwrite the it with our own
	inlineEditPost.edit = function ( postId ) {
		// let's merge arguments of the original function
		wpInlineEditFunction.apply( this, arguments );
		// get the post ID from the argument
		let id = 0;
		if ( typeof postId === 'object' ) {
			// if it is object, get the ID number
			id = parseInt( this.getId( postId ) );
		}
		//if post id exists
		if ( id > 0 ) {
			// add rows to variables
			const specificPostEditRow = $( '#edit-' + id ),
				specificPostRow = $( '#post-' + id ),
				productPrice = $( '.column-price', specificPostRow )
					.text()
					.substring( 1 ); //  remove $ sign
			// add rows to variables
			let featuredProduct = false; // let's say by default checkbox is unchecked
			// check if the Featured Product column says Yes
			if ( $( '.column-featured', specificPostRow ).text() === 'Yes' )
				featuredProduct = true;
			// populate the inputs with column data
			$( ':input[name="price"]', specificPostEditRow ).val(
				productPrice
			);
			$( ':input[name="featured"]', specificPostEditRow ).prop(
				'checked',
				featuredProduct
			);
		}
	};
} );

```
