Leave a Reply

1 comment

  1. Hook into save_post, count the words, and update the post meta field.

    Sample code, not tested:

    add_action( 'save_post', 'wpse_73563_save_word_count', 10, 2 );
    
    function wpse_73563_save_word_count( $post_ID, $post )
    {
        if ( ! current_user_can( 'edit_' . $_POST['post_type'], $post_ID ) )
        {
            return FALSE;
        }
    
        $count = t5_word_count( $post->post_content );
    
        update_post_meta( $post_ID, '_word_count', ( 200 > $count ? 2 : 1 ) );
    }