Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function excerpt_count_js(){
- echo '<script>jQuery(document).ready(function(){
- if( jQuery("#excerpt").length ) {
- jQuery("#postexcerpt .handlediv").after("<input type=\'text\' value=\'0\' maxlength=\'3\' size=\'3\' id=\'excerpt_counter\' readonly=\'\' style=\'background:#fff; position:absolute;top:0.2em;right:2em; color:#666;\'>");
- jQuery("#excerpt_counter").val(jQuery("#excerpt").val().length);
- jQuery("#excerpt").keyup( function() {
- jQuery("#excerpt_counter").val(jQuery("#excerpt").val().length);
- });
- }
- if( jQuery("#wp-word-count").length ) {
- jQuery("#wp-word-count").after("<td id=\'wp-character-count\'>'. __( 'Character (text only) count:' ) .'<span class=\'character-count\'>0</span></td>");
- }
- if ( jQuery("#content_ifr") ) {
- $update = function() {
- tinyMCE.triggerSave();
- jQuery("#wp-character-count .character-count").html(jQuery("#content").val().length);
- }
- setInterval(function() { $update(); }, 1000);
- }
- else {
- jQuery("#wp-character-count .character-count").html(jQuery("#wp-content-wrap .wp-editor-area").val().length);
- jQuery("#wp-content-wrap .wp-editor-area").keyup( function() {
- jQuery("#wp-character-count .character-count").html(jQuery("#wp-content-wrap .wp-editor-area").val().length);
- });
- }
- });</script>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement