Disable Copy or Paste action for text box

jQuery(document).ready(function(){
    jQuery('#input').bind('cut copy paste', function(e) {
        alert('copy and paste disabled');
        e.preventDefault();
    });
});
Advertisements

Sort custom post table rows in wp-admin

add_filter( 'manage_edit-{custom_post_type}_columns', 'edit_custom_columns' ) ;

function edit_custom_columns( $columns ) {
	$columns = array(
		'cb' => '<input type="checkbox" />',
		'title' => __( 'Tite' ),
		'category' => __( 'Category' ),
		'date' => __( 'Date' )
	);
	return $columns;
}

Rename Woo-commerce Order Status Programmatically

function aviweb_renaming_order_status( $order_statuses ) {
    foreach ( $order_statuses as $key => $status ) {
	if ( 'wc-processing' === $key ) {
		$order_statuses['wc-processing'] = _x( 'In progress', 'Order status', 'woocommerce' );
	}
	if ( 'wc-completed' === $key ) {
		$order_statuses['wc-completed'] = _x( 'Delivered', 'Order status', 'woocommerce' );
	}
     }
     return $order_statuses;
}
add_filter( 'wc_order_statuses', 'aviweb_renaming_order_status' );