|
4 | 4 | Plugin Name: ACF Input Counter |
5 | 5 | Plugin URI: https://github.com/Hube2/acf-input-counter/ |
6 | 6 | Description: Show character count for limited text and textarea fields |
7 | | - Version: 1.4.1 |
| 7 | + Version: 1.5 |
8 | 8 | Author: John A. Huebner II |
9 | 9 | Author URI: https://github.com/Hube2/ |
10 | 10 | Text-domain: acf-counter |
|
20 | 20 |
|
21 | 21 | class acf_input_counter { |
22 | 22 |
|
23 | | - private $version = '1.4.1'; |
| 23 | + private $version = '1.5'; |
24 | 24 |
|
25 | 25 | public function __construct() { |
26 | 26 | add_action('plugins_loaded', array($this, 'acf_counter_load_plugin_textdomain')); |
@@ -71,7 +71,6 @@ public function scripts() { |
71 | 71 | } // end public function scripts |
72 | 72 |
|
73 | 73 | public function render_field($field) { |
74 | | - //echo '<pre>'; print_r($field); echo '</pre>'; |
75 | 74 | if (!$this->run() || |
76 | 75 | !$field['maxlength'] || |
77 | 76 | ($field['type'] != 'text' && $field['type'] != 'textarea')) { |
@@ -118,6 +117,7 @@ public function render_field($field) { |
118 | 117 | $display = apply_filters('acf-input-counter/display', $display); |
119 | 118 | $display = str_replace('%%len%%', '<span class="count">'.$len.'</span>', $display); |
120 | 119 | $display = str_replace('%%max%%', $max, $display); |
| 120 | + $display = str_replace('%%remain%%', ( $max - $len ), $display); |
121 | 121 | ?> |
122 | 122 | <span class="char-count"> |
123 | 123 | <?php |
|
0 commit comments