Support » Fixing WordPress » Limit the Post Size (Not just the Excerpt size)

  • Re: My goal is to simply limit the post size on the admin side of the post. I want to limit the entire system to only allow posts that are 300 characters throughout the site. Any ideas on how to do this?

    So, here is my starting point that I’ve found thus far, now trying to add the same functionality to the “post” area:

    wp-admin/edit-form-advanced.php

    <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off"
                   onKeyDown= "limitText(this.form.post_title,this.form.countdown,20);"
                   onKeyUp="limitText(this.form.post_title,this.form.countdown,20);"
    />

    wp-admin/js/word-count.js

    function limitText(limitField, limitCount, limitNum) {
    	if (limitField.value.length > limitNum) {
    		limitField.value = limitField.value.substring(0, limitNum);
    	} else {
    		limitCount.value = limitNum - limitField.value.length;
    	}
    }

    Originally from This Great Article!

    But now I want this for the POST area too, ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Limit the Post Size (Not just the Excerpt size)’ is closed to new replies.