WordPress built with many hooks and action that we can put it and make it easy to hack original WordPress code without broken overall functions. On this sample we will show you how to define a minimum word count per post on your WordPress.
This function is useful, if you want to be able to keep a minimum word count for your posts. To use this code put this code on functions.php
function minWord($content){
global $post;
$num = 100; //set this to the minimum number of words
$content = $post->post_content;
if (str_word_count($content) < $num)
wp_die( __('Error: your post is below the minimum word count.') );
}
add_action('publish_post', 'minWord');
Thanks for WP Recipes for share this tips, this code original written by Pippin WIlliamson



