Add post content word count column to admin posts list in WordPress

add_filter( 'manage_edit-post_columns',        'add_words_column', PHP_INT_MAX );
add_action( 'manage_post_posts_custom_column', 'render_words_column', PHP_INT_MAX );
/**
 * add_words_column.
 */
function add_words_column( $columns ) {
	$columns['word_count'] = 'Words';
	return $columns;
}
/**
 * render_words_column.
 */
function render_words_column( $column ) {
	if ( 'word_count' != $column ) {
		return;
	}
	echo str_word_count( strip_tags( apply_filters( 'the_content', get_post_field( 'post_content', get_the_ID() ) ) ) );
}

Open external WooCommerce product in new window

// Single product page
add_action( 'woocommerce_before_add_to_cart_button', 'replace_external_with_custom_add_to_cart_on_single_start' );
add_action( 'woocommerce_after_add_to_cart_button',  'replace_external_with_custom_add_to_cart_on_single_end' );
function replace_external_with_custom_add_to_cart_on_single_start() {
	global $product;
	if ( $product->is_type( 'external' ) ) {
		ob_start();
	}
}
function replace_external_with_custom_add_to_cart_on_single_end() {
	global $product;
	if ( $product->is_type( 'external' ) ) {
		$button_html = ob_get_contents();
		ob_end_clean();
		echo str_replace( 'a href=', 'a target="_blank" href=', $button_html );
	}
}
// Archive (category) pages
add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_external_with_custom_add_to_cart_in_loop' );
function replace_external_with_custom_add_to_cart_in_loop( $link_html ) {
	global $product;
	if ( $product->is_type( 'external' ) ) {
		$link_html = str_replace( 'a rel=', 'a target="_blank" rel=', $link_html );
	}
	return $link_html;
}

Limit Checkout Phone field to 10 numbers – Validation

// You can add a custom placeholder to add a hint for your CUs what you expect
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields2' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields2( $fields ) {
	
	$fields['billing']['billing_phone']['placeholder'] = '09XXXXXXXXX';

    return $fields;
}

/****************************************************************/
/* VALIDATION FOR PHONE FIELD THIS WILL THROW AN ERROR MESSAGE  */
/****************************************************************/

/**
 * Process the checkout
 **
add_action('woocommerce_checkout_process', 'my_custom_checkout_field_process');

function my_custom_checkout_field_process() {
	global $woocommerce;

	// Check if set, if its not set add an error. This one is only requite for companies
	if ( ! (preg_match('/^[0-9]{10}$/D', $_POST['billing_phone'] ))){
		wc_add_notice( "The Phone should contain only 10 digits"  ,'error' );
	}
	
}