Change date format in WordPress comments

add_filter( 'get_comment_date', 'aviweb_comment_date' );    
function aviweb_comment_date( $date ) {
	$date = date("d/m/Y");   
	return $date;
}

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' );

Custom post type redirect in WordPress

add_action( 'template_redirect', 'aviweb_redirect_post_type' );
function aviweb_redirect_post_type() {
	$queried_post_type = get_query_var('post_type');
	if ( is_single() && 'custom_post' ==  $queried_post_type ) {
		$redirection_url = get_site_url() . '/custom_page';
		wp_redirect( $redirection_url, 301 );
	exit;
	}		
}

Get WordPress dynamic URL in JS file

//Include JS file

wp_enqueue_script('js_file', plugins_url('assets/js/js_file.js', __FILE__), array('jquery'), false);
wp_localize_script( 'js_file', 'WPURLS', array(
    'ajax_url' => admin_url( 'admin-ajax.php' )
));
	
// JS file
var url = WPURLS.ajax_url;