This worked for me... Create a new js file and equeue it admin panel
/**
* Enqueue a script in the WordPress admin, excluding edit.php.
*
* @param int $hook Hook suffix for the current admin page.
*/
function wpdocs_selectively_enqueue_admin_script( $hook ) {
// if ( 'edit.php' != $hook ) {
// return;
// }
wp_enqueue_script( 'my_custom_woocommerce_script', get_template_directory_uri() . '/woocommerce/assets/meta-boxes-order.js', array(), '1.0' );
}
add_action( 'admin_enqueue_scripts', 'wpdocs_selectively_enqueue_admin_script' );
In the js file add this below code
jQuery(document).ready(function(){
alert("ok"); // only for testing purpose that this file is loaded
jQuery(".order_data_column_container .order_data_column p:eq(0) input").attr('disabled', true);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…