Timeline Express - Version 1.0.3

Version Description

  • Included new function to retain formatting in the announcement excerpt in the timeline (te_wp_trim_words_retain_formatting())
Download this release

Release Info

Developer eherman24
Plugin Icon 128x128 Timeline Express
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

README.md CHANGED
@@ -1,4 +1,4 @@
1
- Timeline Express v1.0.2
2
  ================
3
 
4
  Timeline express allows you to create a vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
@@ -90,6 +90,9 @@ Have an idea for a future release feature? I love hearing about new ideas! You c
90
 
91
 
92
  ### Changelog
 
 
 
93
  ###### 1.0.2
94
  * Add display order setting to specify ascending or descending order of announcements in the timeline
95
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
@@ -101,6 +104,9 @@ Have an idea for a future release feature? I love hearing about new ideas! You c
101
  * Initial Release to the wordpress respository
102
 
103
  ### Upgrade Notice
 
 
 
104
  ###### 1.0.2
105
  * Add display order setting to specify ascending or descending order of announcements in the timeline
106
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
1
+ Timeline Express v1.0.3
2
  ================
3
 
4
  Timeline express allows you to create a vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
90
 
91
 
92
  ### Changelog
93
+ ###### 1.0.3
94
+ * Included new function to retain formatting in the announcement excerpt in the timeline (te_wp_trim_words_retain_formatting())
95
+
96
  ###### 1.0.2
97
  * Add display order setting to specify ascending or descending order of announcements in the timeline
98
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
104
  * Initial Release to the wordpress respository
105
 
106
  ### Upgrade Notice
107
+ ###### 1.0.3
108
+ * Included new function to retain formatting in the announcement excerpt in the timeline (te_wp_trim_words_retain_formatting())
109
+
110
  ###### 1.0.2
111
  * Add display order setting to specify ascending or descending order of announcements in the timeline
112
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
classes/class.timeline-express.php CHANGED
@@ -784,7 +784,7 @@ if(!class_exists("timelineExpressBase"))
784
  $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
785
  }
786
  ?>
787
- <span class="the-excerpt"><?php echo apply_filters( 'the_content' , wp_trim_words( get_the_content() , $trim_array[$random_trim] , $elipses ) ); ?></span>
788
  <?php
789
  } else {
790
  $trim_length = $this->timeline_express_optionVal['excerpt-trim-length'];
@@ -796,7 +796,7 @@ if(!class_exists("timelineExpressBase"))
796
  $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
797
  }
798
  ?>
799
- <span class="the-excerpt"><?php echo apply_filters( 'the_content' , wp_trim_words( get_the_content() , $trim_length , $elipses ) ); ?></span>
800
  <?php
801
  }
802
  ?>
@@ -820,6 +820,42 @@ if(!class_exists("timelineExpressBase"))
820
  ob_end_clean();
821
  return $shortcode;
822
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
823
 
824
  /***** ADMINISTRATION MENUS
825
  ****************************************************************************************************/
@@ -904,6 +940,11 @@ if(!class_exists("timelineExpressBase"))
904
  $this->timeline_express_optionVal['announcement-display-order'] = 'ASC';
905
  $this->timeline_express_optionVal['version'] = '1.0.2';
906
  }
 
 
 
 
 
907
 
908
 
909
  } // end class timelineExpressBase
784
  $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
785
  }
786
  ?>
787
+ <span class="the-excerpt"><?php echo apply_filters( 'the_content' , $this->te_wp_trim_words_retain_formatting( get_the_content() , $trim_array[$random_trim] , $elipses ) ); ?></span>
788
  <?php
789
  } else {
790
  $trim_length = $this->timeline_express_optionVal['excerpt-trim-length'];
796
  $read_more_button = '<a href="' . get_the_permalink() . '" class="cd-read-more btn btn-primary">Read more</a>';
797
  }
798
  ?>
799
+ <span class="the-excerpt"><?php echo apply_filters( 'the_content' , $this->te_wp_trim_words_retain_formatting( get_the_content() , $trim_length , $elipses ) ); ?></span>
800
  <?php
801
  }
802
  ?>
820
  ob_end_clean();
821
  return $shortcode;
822
  }
823
+
824
+ /* Adapt WordPress core wp_trim_words to retain formatting */
825
+ function te_wp_trim_words_retain_formatting( $text, $num_words = 55, $more = null ) {
826
+ if ( null === $more )
827
+ $more = __( '&hellip;' );
828
+ $original_text = $text;
829
+ /* translators: If your word count is based on single characters (East Asian characters),
830
+ enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
831
+ if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
832
+ $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
833
+ preg_match_all( '/./u', $text, $words_array );
834
+ $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
835
+ $sep = '';
836
+ } else {
837
+ $words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
838
+ $sep = ' ';
839
+ }
840
+ if ( count( $words_array ) > $num_words ) {
841
+ array_pop( $words_array );
842
+ $text = implode( $sep, $words_array );
843
+ $text = $text . $more;
844
+ } else {
845
+ $text = implode( $sep, $words_array );
846
+ }
847
+ /**
848
+ * Filter the text content after words have been trimmed.
849
+ *
850
+ * @since 3.3.0
851
+ *
852
+ * @param string $text The trimmed text.
853
+ * @param int $num_words The number of words to trim the text to. Default 5.
854
+ * @param string $more An optional string to append to the end of the trimmed text, e.g. &hellip;.
855
+ * @param string $original_text The text before it was trimmed.
856
+ */
857
+ return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
858
+ }
859
 
860
  /***** ADMINISTRATION MENUS
861
  ****************************************************************************************************/
940
  $this->timeline_express_optionVal['announcement-display-order'] = 'ASC';
941
  $this->timeline_express_optionVal['version'] = '1.0.2';
942
  }
943
+
944
+ private function runUpdateTasks_1_0_2() {
945
+ $this->timeline_express_optionVal['announcement-display-order'] = isset( $this->timeline_express_optionVal['announcement-display-order'] ) ? $this->timeline_express_optionVal['announcement-display-order'] : 'ASC'; // check if the user this setting previously set up
946
+ $this->timeline_express_optionVal['version'] = '1.0.3';
947
+ }
948
 
949
 
950
  } // end class timelineExpressBase
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.evan-herman.com/contact/?contact-reason=I%20want%20to%20
4
  Tags: vertical, timeline, animated, css3, animations, evan, herman, evan herman, easy, time, line, font awesome, font, awesome, announcements, notifications, simple, events, calendar, scroll, triggered, scrolling, animated, fade, in, fade in
5
  Requires at least: 3.9
6
  Tested up to: 4.0
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
 
10
  Timeline express allows you to create a beautiful vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
@@ -106,6 +106,9 @@ Have an idea for a future release feature? I love hearing about new ideas! You c
106
  5. Timeline Express full settings page
107
 
108
  == Changelog ==
 
 
 
109
  = 1.0.2 =
110
  * Add a display order setting to set Ascending or Descending display order for announcements in the timeline
111
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
@@ -117,6 +120,9 @@ Have an idea for a future release feature? I love hearing about new ideas! You c
117
  * Initial Release to the wordpress respository
118
 
119
  == Upgrade Notice ==
 
 
 
120
  = 1.0.2 =
121
  * Add display order setting to specify ascending or descending order of announcements in the timeline
122
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
4
  Tags: vertical, timeline, animated, css3, animations, evan, herman, evan herman, easy, time, line, font awesome, font, awesome, announcements, notifications, simple, events, calendar, scroll, triggered, scrolling, animated, fade, in, fade in
5
  Requires at least: 3.9
6
  Tested up to: 4.0
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
 
10
  Timeline express allows you to create a beautiful vertical animated and responsive timeline of posts , without writing a single line of code. Sweet!
106
  5. Timeline Express full settings page
107
 
108
  == Changelog ==
109
+ = 1.0.3 =
110
+ * Included new function to retain formatting in the announcement excerpt in the timeline (`te_wp_trim_words_retain_formatting()`)
111
+
112
  = 1.0.2 =
113
  * Add a display order setting to set Ascending or Descending display order for announcements in the timeline
114
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
120
  * Initial Release to the wordpress respository
121
 
122
  == Upgrade Notice ==
123
+ = 1.0.3 =
124
+ * Included new function to retain formatting in the announcement excerpt in the timeline (te_wp_trim_words_retain_formatting())
125
+
126
  = 1.0.2 =
127
  * Add display order setting to specify ascending or descending order of announcements in the timeline
128
  * Fixed "cannot access settings page" when clicking on the settings tab when on the settings page already
timeline-express.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Timeline Express
5
  Plugin URI: http://www.evan-herman.com
6
  Description: Create a beautiful vertical, CSS3 animated and responsive timeline in minutes flat without writing code.
7
- Version: 1.0.2
8
  Author: Evan Herman
9
  Author URI: http://www.evan-herman.com
10
  License: GPL2
@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
 
30
  /** Configuration **/
31
  if(!defined('TIMELINE_EXPRESS_DEBUG')) define('TIMELINE_EXPRESS_DEBUG', false);
32
- if(!defined('TIMELINE_EXPRESS_VERSION_CURRENT')) define('TIMELINE_EXPRESS_VERSION_CURRENT', '1.0.2');
33
  if(!defined('TIMELINE_EXPRESS_REQ_PHP')) define('TIMELINE_EXPRESS_REQ_PHP', '5.0');
34
  if(!defined('TIMELINE_EXPRESS_AUTHOR')) define('TIMELINE_EXPRESS_AUTHOR', 'Evan Herman');
35
  if(!defined('TIMELINE_EXPRESS_SITE')) define('TIMELINE_EXPRESS_SITE', site_url().'/');
4
  Plugin Name: Timeline Express
5
  Plugin URI: http://www.evan-herman.com
6
  Description: Create a beautiful vertical, CSS3 animated and responsive timeline in minutes flat without writing code.
7
+ Version: 1.0.3
8
  Author: Evan Herman
9
  Author URI: http://www.evan-herman.com
10
  License: GPL2
29
 
30
  /** Configuration **/
31
  if(!defined('TIMELINE_EXPRESS_DEBUG')) define('TIMELINE_EXPRESS_DEBUG', false);
32
+ if(!defined('TIMELINE_EXPRESS_VERSION_CURRENT')) define('TIMELINE_EXPRESS_VERSION_CURRENT', '1.0.3');
33
  if(!defined('TIMELINE_EXPRESS_REQ_PHP')) define('TIMELINE_EXPRESS_REQ_PHP', '5.0');
34
  if(!defined('TIMELINE_EXPRESS_AUTHOR')) define('TIMELINE_EXPRESS_AUTHOR', 'Evan Herman');
35
  if(!defined('TIMELINE_EXPRESS_SITE')) define('TIMELINE_EXPRESS_SITE', site_url().'/');