Код: Выделить всё
add_action( 'admin_footer', 'min_max_step_desc_quick_edit_populate');
function min_max_step_desc_quick_edit_populate(){
?>
jQuery( function($){
console.log('min max step code is enabled');
const wp_inline_edit_function = inlineEditPost.edit;
// we overwrite the it with our own
inlineEditPost.edit = function( post_id ) {
// let's merge arguments of the original function
wp_inline_edit_function.apply( this, arguments );
// get the post ID from the argument
if ( typeof( post_id ) == 'object' ) { // if it is object, get the ID number
post_id = parseInt( this.getId( post_id ) );
}
// add rows to variables
const edit_row = $( '#edit-' + post_id )
const post_row = $( '#post-' + post_id )
const minQty = $( '.column-min', post_row ).text().substring() // remove $ sign
const maxQty = $( '.column-max', post_row ).text().substring() // remove $ sign
const stepQty = $( '.column-step', post_row ).text().substring() // remove $ sign
const productDesc = $( '.column-desc', post_row ).text().substring() // remove $ sign
// populate the inputs with column data
$( ':input[name="min"]', edit_row ).val( minQty );
$( ':input[name="max"]', edit_row ).val( maxQty );
$( ':input[name="step"]', edit_row ).val( stepQty );
$( ':input[name="desc"]', edit_row ).val( productDesc );
}
});
Min
Max
Step
Description
Подробнее здесь: [url]https://stackoverflow.com/questions/77091398/add-custom-fields-to-admin-products-quick-edit-in-woocommerce-3-2[/url]