List category posts - Version 0.40.0

Version Description

= 0.37 =

When using content=yes, if the post has a more tag, the plugin will only show the content previous to the more tag and not all the content as it used before (it now supports the more tag the same way as WordPress).

= 0.34 = * Now the plugin accepts either class or tag or both for styling elements (such as date, author, etc. to display). When just using a tag, it will sorround the element with that tag. When using just a class, it will sorround the element between span tags and the given CSS class. Check Other notes under HTML & CSS Customization for more info. * Fixed bug on post_status, it used to show all published posts and if user was logged in, all private ones too. Now you can specify 'private' to just display private posts, and draft, publish, draft, etc (See post_status param on the instructions for more info).

= 0.25 = * Translation support.

= 0.18 = Template system was upgraded with new options. Backwards compatible, but you can better customize the way the post contents are displayed. Check templates/default.php.

= 0.17 = Upgrade your templates: Templates system was rewritten, so your current templates will probably not work. Check out the new default.php file on /templates to see the simpler new way to work with templates.

= 0.13.2 = Thumbnail parameter 'thumbnails' changed to 'thumbnail.

= 0.7.2 = Template system has changed. Now the posts loop must be defined inside the template. Check templates/default.php for an example.

= 0.8 = Widget built for WordPress 2.8's Widget API, so you need at least WP 2.8 to use the widget.

= 0.9 = Template system has changed. Custom templates should be stored in WordPress theme folder.

Download this release

Release Info

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

Code changes from version 0.39 to 0.40.0

include/CatList.php CHANGED
@@ -378,9 +378,13 @@ class CatList{
378
  $lcp_content = apply_filters('the_content', $lcp_content);
379
  $lcp_content = str_replace(']]>', ']]&gt', $lcp_content);
380
 
381
- if ( preg_match('/<!--more(.*?)?-->/', $lcp_content, $matches) ):
382
- $lcp_more = __('Continue reading &rarr;', 'list-category-posts');
383
- $lcp_post_content = explode($matches[0], $lcp_content, 2);
 
 
 
 
384
  $lcp_content = $lcp_post_content[0] .
385
  ' <a href="' . get_permalink($single->ID) . ' title="' . "$lcp_more" . '">' .
386
  $lcp_more . '</a>';
378
  $lcp_content = apply_filters('the_content', $lcp_content);
379
  $lcp_content = str_replace(']]>', ']]&gt', $lcp_content);
380
 
381
+ if ( preg_match('/[\S\s]+(<!--more(.*?)?-->)[\S\s]+/', $lcp_content, $matches) ):
382
+ if( empty($this->params['posts_morelink']) ):
383
+ $lcp_more = __('Continue reading &rarr;', 'list-category-posts');
384
+ else:
385
+ $lcp_more = '';
386
+ endif;
387
+ $lcp_post_content = explode($matches[1], $lcp_content);
388
  $lcp_content = $lcp_post_content[0] .
389
  ' <a href="' . get_permalink($single->ID) . ' title="' . "$lcp_more" . '">' .
390
  $lcp_more . '</a>';
include/CatListDisplayer.php CHANGED
@@ -174,17 +174,7 @@ class CatListDisplayer {
174
 
175
  $lcp_display_output = '<'. $tag . $class . '>';
176
 
177
- if (!empty($this->params['title_tag'])):
178
- if (!empty($this->params['title_class'])):
179
- $lcp_display_output .= $this->get_post_title($single,
180
- $this->params['title_tag'],
181
- $this->params['title_class']);
182
- else:
183
- $lcp_display_output .= $this->get_post_title($single, $this->params['title_tag']);
184
- endif;
185
- else:
186
- $lcp_display_output .= $this->get_post_title($single) . ' ';
187
- endif;
188
 
189
  // Comments count
190
  if (!empty($this->params['comments_tag'])):
@@ -313,26 +303,44 @@ class CatListDisplayer {
313
  return $this->assign_style($info, $tag);
314
  }
315
 
316
- private function get_post_title($single, $tag = null, $css_class = null){
317
  $info = '<a href="' . get_permalink($single->ID) .
318
- '" title="' . $single->post_title. '"';
 
319
  if (!empty($this->params['link_target'])):
320
  $info .= ' target="' . $this->params['link_target'] . '" ';
321
  endif;
 
 
 
 
 
 
 
322
  $info .= '>' . apply_filters('the_title', $single->post_title, $single->ID) . '</a>';
323
 
324
  if( !empty($this->params['post_suffix']) ):
325
  $info .= " " . $this->params['post_suffix'];
326
  endif;
327
 
328
- return $this->assign_style($info, $tag, $css_class);
 
 
 
 
 
 
 
 
 
 
329
  }
330
 
331
  private function get_category_link($tag = null, $css_class = null){
332
  $info = $this->catlist->get_category_link();
333
  return $this->assign_style($info, $tag, $css_class);
334
  }
335
-
336
  private function get_morelink($tag = null, $css_class = null){
337
  $info = $this->catlist->get_morelink();
338
  return $this->assign_style($info, $tag, $css_class);
174
 
175
  $lcp_display_output = '<'. $tag . $class . '>';
176
 
177
+ $lcp_display_output .= $this->get_post_title($single);
 
 
 
 
 
 
 
 
 
 
178
 
179
  // Comments count
180
  if (!empty($this->params['comments_tag'])):
303
  return $this->assign_style($info, $tag);
304
  }
305
 
306
+ private function get_post_title($single){
307
  $info = '<a href="' . get_permalink($single->ID) .
308
+ '" title="' . wptexturize($single->post_title) . '"';
309
+
310
  if (!empty($this->params['link_target'])):
311
  $info .= ' target="' . $this->params['link_target'] . '" ';
312
  endif;
313
+
314
+ if ( !empty($this->params['title_class'] ) &&
315
+ empty($this->params['title_tag']) ):
316
+ $info .= ' class=' . $this->params['title_class'];
317
+ endif;
318
+
319
+
320
  $info .= '>' . apply_filters('the_title', $single->post_title, $single->ID) . '</a>';
321
 
322
  if( !empty($this->params['post_suffix']) ):
323
  $info .= " " . $this->params['post_suffix'];
324
  endif;
325
 
326
+ if (!empty($this->params['title_tag'])){
327
+ $pre = "<" . $this->params['title_tag'];
328
+ if (!empty($this->params['title_class'])){
329
+ $pre .= " class=" . $this->params['title_class'];
330
+ }
331
+ $pre .= ">";
332
+ $post = "</" . $this->params['title_tag'] . ">";
333
+ $info = $pre . $info . $post;
334
+ }
335
+
336
+ return $info;
337
  }
338
 
339
  private function get_category_link($tag = null, $css_class = null){
340
  $info = $this->catlist->get_category_link();
341
  return $this->assign_style($info, $tag, $css_class);
342
  }
343
+
344
  private function get_morelink($tag = null, $css_class = null){
345
  $info = $this->catlist->get_morelink();
346
  return $this->assign_style($info, $tag, $css_class);
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.39
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
@@ -114,7 +114,6 @@ class ListCategoryPosts{
114
 
115
  add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
116
 
117
-
118
  function lpc_meta($links, $file) {
119
  $plugin = plugin_basename(__FILE__);
120
 
@@ -141,7 +140,7 @@ function lcp_pagination_css(){
141
  $css_file = WP_PLUGIN_URL . '/' . basename( __DIR__ ) . '/lcp_paginator.css';
142
  endif;
143
 
144
- wp_enqueue_style( 'lcp_paginator', $css_file, false, '2.70' );
145
  }
146
 
147
  /**
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.40
7
  Author: Fernando Briano
8
  Author URI: http://picandocodigo.net/
9
 
114
 
115
  add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
116
 
 
117
  function lpc_meta($links, $file) {
118
  $plugin = plugin_basename(__FILE__);
119
 
140
  $css_file = WP_PLUGIN_URL . '/' . basename( __DIR__ ) . '/lcp_paginator.css';
141
  endif;
142
 
143
+ wp_enqueue_style( 'lcp_paginator', $css_file);
144
  }
145
 
146
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: fernandobt
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
- Tested up to: 3.7.1
7
- Stable tag: 0.39
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -221,7 +221,7 @@ The parameters are:
221
  `autor_tag, author_class, catlink_tag, catlink_class, comments_tag, comments_class, date_tag, date_class,
222
  excerpt_tag, excerpt_class, morelink_class, thumbnail_class, title_tag, title_class, posts_morelink_class`
223
 
224
- So for example, let's say you want to wrap the displayed comments count with the p tag and a "lcp_comments" class, you would do:
225
  `[catlist id=7 comments=yes comments_tag=p comments_class=lcp_comments]`
226
  This would produce the following code:
227
  `<p class="lcp_comments"> (3)</p>`
@@ -236,6 +236,18 @@ Elements without a specified tag, but a specified class, will be wrapped with a
236
  Will produce the following:
237
  `<span class="lcp_date">October 23, 2013</span>`
238
 
 
 
 
 
 
 
 
 
 
 
 
 
239
 
240
  == Template System ==
241
 
@@ -340,6 +352,15 @@ Template system has changed. Custom templates should be stored in WordPress them
340
 
341
  == Changelog ==
342
 
 
 
 
 
 
 
 
 
 
343
  = 0.39 =
344
 
345
  * Adds "post suffix" parameter, to add a String after each post
3
  Donate Link: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support
4
  Tags: list, categories, posts, cms
5
  Requires at least: 3.3
6
+ Tested up to: 3.8
7
+ Stable tag: 0.40
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
221
  `autor_tag, author_class, catlink_tag, catlink_class, comments_tag, comments_class, date_tag, date_class,
222
  excerpt_tag, excerpt_class, morelink_class, thumbnail_class, title_tag, title_class, posts_morelink_class`
223
 
224
+ So let's say you want to wrap the displayed comments count with the p tag and a "lcp_comments" class, you would do:
225
  `[catlist id=7 comments=yes comments_tag=p comments_class=lcp_comments]`
226
  This would produce the following code:
227
  `<p class="lcp_comments"> (3)</p>`
236
  Will produce the following:
237
  `<span class="lcp_date">October 23, 2013</span>`
238
 
239
+ The only exceptions here are the **title_tag** and **title_class**
240
+ parameters. If you only use the **title_class** parameter, the CSS
241
+ class will be assigned to the `a` tag like this:
242
+ `[catlist id=1 title_class="lcp_title"]`
243
+ Will produce:
244
+ `<a href="http://127.0.0.1/wordpress/?p=38" title="Test" class="lcp_title">Test</a>`
245
+ But if you use both:
246
+ `[catlist numberposts=5 title_class=lcp_title tag=h4]`
247
+ You will get:
248
+ `<h4 class="lcp_title">
249
+ <a title="Hipchat" href="http://127.0.0.1:8080/wordpress/?p=40"></a>
250
+ </h4>`
251
 
252
  == Template System ==
253
 
352
 
353
  == Changelog ==
354
 
355
+ = 0.40 =
356
+
357
+ * Tested with WordPress 3.8
358
+ * Removes unnecessary stuff on wp_enqueue_styles
359
+ * Fixes validation when using quotes in title
360
+ * Fixes on <!--more--> tag
361
+ * Fixes on title HTML tag and CSS class. (*See HTML & CSSb
362
+ Customization* on [Other Notes](http://wordpress.org/plugins/list-category-posts/other_notes/) to check the expected behaviour)
363
+
364
  = 0.39 =
365
 
366
  * Adds "post suffix" parameter, to add a String after each post