Advanced Excerpt - Version 4.2.6

Version Description

  • New "Finish" option that counts exact characters including blank spaces.
Download this release

Release Info

Developer wpkube
Plugin Icon wp plugin Advanced Excerpt
Version 4.2.6
Comparing to
See all releases

Code changes from version 4.2.5 to 4.2.6

advanced-excerpt.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Advanced Excerpt
4
  Plugin URI: http://wordpress.org/plugins/advanced-excerpt/
5
  Description: Control the appearance of WordPress post excerpts
6
- Version: 4.2.5
7
  Author: WPKube
8
  Author URI: https://wpkube.com
9
  */
10
 
11
- $GLOBALS['advanced_excerpt_version'] = '4.2.5';
12
 
13
  function advanced_excerpt_load_textdomain() {
14
  load_plugin_textdomain( 'advanced-excerpt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
3
  Plugin Name: Advanced Excerpt
4
  Plugin URI: http://wordpress.org/plugins/advanced-excerpt/
5
  Description: Control the appearance of WordPress post excerpts
6
+ Version: 4.2.6
7
  Author: WPKube
8
  Author URI: https://wpkube.com
9
  */
10
 
11
+ $GLOBALS['advanced_excerpt_version'] = '4.2.6';
12
 
13
  function advanced_excerpt_load_textdomain() {
14
  load_plugin_textdomain( 'advanced-excerpt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
class/advanced-excerpt.php CHANGED
@@ -310,8 +310,12 @@ class Advanced_Excerpt {
310
  if ( 'words' == $length_type ) { // Count words
311
  $w++;
312
  } else { // Count/trim characters
313
- $chars = trim( $t ); // Remove surrounding space
314
- $c = strlen( $chars );
 
 
 
 
315
  if ( $c + $w > $length && 'sentence' != $finish ) { // Token is too long
316
  $c = ( 'word' == $finish ) ? $c : $length - $w; // Keep token to finish word
317
  $t = substr( $t, 0, $c );
310
  if ( 'words' == $length_type ) { // Count words
311
  $w++;
312
  } else { // Count/trim characters
313
+ if ( $finish == 'exact_w_spaces' ) {
314
+ $chars = $t;
315
+ } else {
316
+ $chars = trim( $t );
317
+ }
318
+ $c = mb_strlen( $chars );
319
  if ( $c + $w > $length && 'sentence' != $finish ) { // Token is too long
320
  $c = ( 'word' == $finish ) ? $c : $length - $w; // Keep token to finish word
321
  $t = substr( $t, 0, $c );
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: fancythemes, WPKube
3
  Tags: post excerpt, excerpt, post, content, formatting
4
  Requires at least: 3.2
5
- Tested up to: 4.9.7
6
- Stable tag: 4.2.5
7
  License: GPLv3
8
 
9
  Control the appearance of WordPress post excerpts
@@ -96,6 +96,9 @@ However, you can [start The Loop manually](http://codex.wordpress.org/The_Loop#M
96
 
97
  == Changelog ==
98
 
 
 
 
99
  = 4.2.5 =
100
  * Fixed the "remove shortcodes from excerpt" functionality
101
 
2
  Contributors: fancythemes, WPKube
3
  Tags: post excerpt, excerpt, post, content, formatting
4
  Requires at least: 3.2
5
+ Tested up to: 5.1
6
+ Stable tag: 4.2.6
7
  License: GPLv3
8
 
9
  Control the appearance of WordPress post excerpts
96
 
97
  == Changelog ==
98
 
99
+ = 4.2.6 =
100
+ * New "Finish" option that counts exact characters including blank spaces.
101
+
102
  = 4.2.5 =
103
  * Fixed the "remove shortcodes from excerpt" functionality
104
 
template/options.php CHANGED
@@ -49,6 +49,9 @@
49
  <input type="radio" id="finish-none" name="finish" value="exact"<?php echo ( 'exact' == $finish ) ? ' checked="checked"' : ''; ?> />
50
  <?php _e( "Exact", 'advanced-excerpt' ); ?>
51
  </label><br />
 
 
 
52
  <label for="finish-word">
53
  <input type="radio" id="finish-word" name="finish" value="word"<?php echo ( 'word' == $finish ) ? ' checked="checked"' : ''; ?> />
54
  <?php _e( "Word", 'advanced-excerpt' ); ?>
49
  <input type="radio" id="finish-none" name="finish" value="exact"<?php echo ( 'exact' == $finish ) ? ' checked="checked"' : ''; ?> />
50
  <?php _e( "Exact", 'advanced-excerpt' ); ?>
51
  </label><br />
52
+ <input type="radio" id="finish-exact-2" name="finish" value="exact_w_spaces"<?php echo ( 'exact_w_spaces' == $finish ) ? ' checked="checked"' : ''; ?> />
53
+ <?php _e( "Exact <small>(count spaces as well)</small>", 'advanced-excerpt' ); ?>
54
+ </label><br />
55
  <label for="finish-word">
56
  <input type="radio" id="finish-word" name="finish" value="word"<?php echo ( 'word' == $finish ) ? ' checked="checked"' : ''; ?> />
57
  <?php _e( "Word", 'advanced-excerpt' ); ?>