List category posts - Version 0.46.2

Version Description

  • Some fixes on displaying excerpt.
Download this release

Release Info

Developer fernandobt
Plugin Icon 128x128 List category posts
Version 0.46.2
Comparing to
See all releases

Code changes from version 0.46.1 to 0.46.2

Files changed (3) hide show
  1. include/CatList.php +19 -13
  2. list_cat_posts.php +1 -1
  3. readme.txt +4 -1
include/CatList.php CHANGED
@@ -438,26 +438,32 @@ class CatList{
438
  }
439
 
440
  public function get_excerpt($single){
441
- if ( !empty($this->params['excerpt']) && $this->params['excerpt']=='yes' &&
442
- !empty($this->params['content']) && !($this->params['content']=='yes' &&
443
- $single->post_content) ):
444
-
445
- if($single->post_excerpt && !empty($this->params['excerpt_overwrite']) &&
446
- $this->params['excerpt_overwrite'] != 'yes'):
447
- return $lcp_excerpt = $this->lcp_trim_excerpt($single->post_excerpt);
448
- endif;
 
 
 
 
 
 
449
 
450
- return $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
451
- else:
452
- return null;
453
- endif;
 
454
  }
455
 
456
  private function lcp_trim_excerpt($text = ''){
457
  $excerpt_length = intval($this->params['excerpt_size']);
458
 
459
  $text = strip_shortcodes($text);
460
- $text = apply_filters('the_content', $text);
461
  $text = apply_filters('the_excerpt', $text);
462
  $text = str_replace(']]>',']]>', $text);
463
 
438
  }
439
 
440
  public function get_excerpt($single){
441
+ if ( !empty($this->params['excerpt']) && $this->params['excerpt']=='yes'){
442
+ switch($single->post_excerpt){
443
+
444
+ case(null):
445
+ $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
446
+ default:
447
+ if(!empty($this->params['excerpt_overwrite']) &&
448
+ $this->params['excerpt_overwrite'] == 'yes'){
449
+ //Content
450
+ $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
451
+ } else {
452
+ $lcp_excerpt = $this->lcp_trim_excerpt($single->post_content);
453
+ }
454
+ }
455
 
456
+ if( strlen($single->post_content) < 1 ){
457
+ $lcp_excerpt = $single->post_title;
458
+ }
459
+ return $lcp_excerpt;
460
+ }
461
  }
462
 
463
  private function lcp_trim_excerpt($text = ''){
464
  $excerpt_length = intval($this->params['excerpt_size']);
465
 
466
  $text = strip_shortcodes($text);
 
467
  $text = apply_filters('the_excerpt', $text);
468
  $text = str_replace(']]>',']]&gt;', $text);
469
 
list_cat_posts.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
- Version: 0.46.1
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
3
  Plugin Name: List category posts
4
  Plugin URI: https://github.com/picandocodigo/List-Category-Posts
5
  Description: List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode. This shortcode accepts a category name or id, the order in which you want the posts to display, and the number of posts to display. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
6
+ Version: 0.46.2
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
- Stable tag: 0.46.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -433,6 +433,9 @@ Template system has changed. Custom templates should be stored in WordPress them
433
 
434
  == Changelog ==
435
 
 
 
 
436
  = 0.46.1 =
437
  * Fixes quotes bug on title tag.
438
  * Only show ellipsis when title.size > title_limit when using the
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
  Tested up to: 3.8.1
7
+ Stable tag: 0.46.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
433
 
434
  == Changelog ==
435
 
436
+ = 0.46.2 =
437
+ * Some fixes on displaying excerpt.
438
+
439
  = 0.46.1 =
440
  * Fixes quotes bug on title tag.
441
  * Only show ellipsis when title.size > title_limit when using the