//限制文章标题输入字数 From wpdaxue.com
function title_count_js(){
echo '
jQuery("#titlewrap").after("
jQuery("#title_counter").val(jQuery("#title").val().length);
jQuery("#title").keyup( function() {
jQuery("#title_counter").val(jQuery("#title").val().length);
});
jQuery("#titlewrap #title").keyup( function() {
var $this = jQuery(this);
if($this.val().length > 46)
$this.val($this.val().substr(0, 46));
});
});';
}
add_action( 'admin_head-post.php', 'title_count_js');
add_action( 'admin_head-post-new.php', 'title_count_js');
//限制文章标题输入字数 From wpdaxue.com
function title_count_js(){
echo '
jQuery("#titlewrap").after("
jQuery("#title_counter").val(jQuery("#title").val().length);
jQuery("#title").keyup( function() {
jQuery("#title_counter").val(jQuery("#title").val().length);
});
jQuery("#titlewrap #title").keyup( function() {
var $this = jQuery(this);
if($this.val().length > 46)
$this.val($this.val().substr(0, 46));
});
});';
}
add_action( 'admin_head-post.php', 'title_count_js');
add_action( 'admin_head-post-new.php', 'title_count_js');