WordPress.org

Ready to get started?Download WordPress

Forums

plugin to lock post before the reach a limit of words (2 posts)

  1. jstrauss
    Member
    Posted 3 years ago #

    Hi,

    I'm searching for a plugin to set a min. number of words on a post and only if this count is arrived the post will be able to publish.
    I hope you can help me.
    Thanks.

  2. Gisha James
    Member
    Posted 3 years ago #

    Hope this will help: http://www.wprecipes.com/how-to-define-a-minimum-word-count-per-post

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.