Version Description
- Added thumbnail to Widget.
- Added thumbnail link to post (http://picod.net/33).
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.19.1 |
Comparing to | |
See all releases |
Code changes from version 0.19 to 0.19.1
- include/CatList.php +1 -1
- include/ListCategoryPostsWidget.php +31 -22
- include/lcp_widget_form.php +32 -20
- list_cat_posts.php +1 -1
- readme.txt +6 -2
include/CatList.php
CHANGED
@@ -205,7 +205,7 @@ class CatList{
|
|
205 |
if ($this->params['thumbnail']=='yes'){
|
206 |
$lcp_thumbnail = '';
|
207 |
if ( has_post_thumbnail($single->ID) ) {
|
208 |
-
|
209 |
}
|
210 |
return $lcp_thumbnail;
|
211 |
} else {
|
205 |
if ($this->params['thumbnail']=='yes'){
|
206 |
$lcp_thumbnail = '';
|
207 |
if ( has_post_thumbnail($single->ID) ) {
|
208 |
+
$lcp_thumbnail = '<a href="' . get_permalink($single->ID).'">' . get_the_post_thumbnail($single->ID, $this->params['thumbnail_size']) . '</a>';
|
209 |
}
|
210 |
return $lcp_thumbnail;
|
211 |
} else {
|
include/ListCategoryPostsWidget.php
CHANGED
@@ -28,38 +28,44 @@ class ListCategoryPostsWidget extends WP_Widget{
|
|
28 |
function widget($args, $instance) {
|
29 |
extract( $args );
|
30 |
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
$category_id = $instance['categoryid'];
|
38 |
$dateformat = ($instance['dateformat']) ? $instance['dateformat'] : get_option('date_format');
|
39 |
$showdate = ($instance['show_date'] == 'on') ? 'yes' : 'no';
|
40 |
$showexcerpt = ($instance['show_excerpt'] == 'on') ? 'yes' : 'no';
|
41 |
$showauthor = ($instance['show_author'] == 'on') ? 'yes' : 'no';
|
42 |
$showcatlink = ($instance['show_catlink'] == 'on') ? 'yes' : 'no';
|
|
|
|
|
43 |
|
44 |
echo $before_widget;
|
45 |
echo $before_title . $title . $after_title;
|
|
|
46 |
$atts = array(
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
63 |
$catlist_displayer = new CatListDisplayer($atts);
|
64 |
echo $catlist_displayer->display();
|
65 |
echo $lcp_result;
|
@@ -82,6 +88,9 @@ class ListCategoryPostsWidget extends WP_Widget{
|
|
82 |
$instance['show_excerpt'] = strip_tags($new_instance['show_excerpt']);
|
83 |
$instance['show_author'] = strip_tags($new_instance['show_author']);
|
84 |
$instance['show_catlink'] = strip_tags($new_instance['show_catlink']);
|
|
|
|
|
|
|
85 |
|
86 |
return $instance;
|
87 |
}
|
28 |
function widget($args, $instance) {
|
29 |
extract( $args );
|
30 |
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
31 |
+
$limit = (is_numeric($instance['limit'])) ? $instance['limit'] : 5;
|
32 |
+
$orderby = ($instance['orderby']) ? $instance['orderby'] : 'date';
|
33 |
+
$order = ($instance['order']) ? $instance['order'] : 'desc';
|
34 |
+
$exclude = ($instance['exclude'] != '') ? $instance['exclude'] : 0;
|
35 |
+
$excludeposts = ($instance['excludeposts'] != '') ? $instance['excludeposts'] : 0;
|
36 |
+
$offset = (is_numeric($instance['offset'])) ? $instance['offset'] : 0;
|
37 |
$category_id = $instance['categoryid'];
|
38 |
$dateformat = ($instance['dateformat']) ? $instance['dateformat'] : get_option('date_format');
|
39 |
$showdate = ($instance['show_date'] == 'on') ? 'yes' : 'no';
|
40 |
$showexcerpt = ($instance['show_excerpt'] == 'on') ? 'yes' : 'no';
|
41 |
$showauthor = ($instance['show_author'] == 'on') ? 'yes' : 'no';
|
42 |
$showcatlink = ($instance['show_catlink'] == 'on') ? 'yes' : 'no';
|
43 |
+
$thumbnail = ($instance['thumbnail'] == 'on') ? 'yes' : 'no';
|
44 |
+
$thumbnail_size = ($instance['thumbnail_size']) ? $instance['thumbnail_size'] : 'thumbnail';
|
45 |
|
46 |
echo $before_widget;
|
47 |
echo $before_title . $title . $after_title;
|
48 |
+
|
49 |
$atts = array(
|
50 |
+
'id' => $category_id,
|
51 |
+
'orderby' => $orderby,
|
52 |
+
'order' => $order,
|
53 |
+
'numberposts' => $limit,
|
54 |
+
'date' => $showdate,
|
55 |
+
'author' => $showauthor,
|
56 |
+
'dateformat' => $dateformat,
|
57 |
+
'template' => 'default',
|
58 |
+
'excerpt' => $showexcerpt,
|
59 |
+
'exclude' => $exclude,
|
60 |
+
'excludeposts' => $excludeposts,
|
61 |
+
'offset' => $offset,
|
62 |
+
//'tags' => '',
|
63 |
+
//'content' => 'no',
|
64 |
+
'catlink' => $showcatlink,
|
65 |
+
'thumbnail' => $thumbnail,
|
66 |
+
'thumbnail_size' => $thumbnail_size
|
67 |
+
);
|
68 |
+
|
69 |
$catlist_displayer = new CatListDisplayer($atts);
|
70 |
echo $catlist_displayer->display();
|
71 |
echo $lcp_result;
|
88 |
$instance['show_excerpt'] = strip_tags($new_instance['show_excerpt']);
|
89 |
$instance['show_author'] = strip_tags($new_instance['show_author']);
|
90 |
$instance['show_catlink'] = strip_tags($new_instance['show_catlink']);
|
91 |
+
$instance['show_catlink'] = strip_tags($new_instance['show_catlink']);
|
92 |
+
$instance['thumbnail'] = strip_tags($new_instance['thumbnail']);
|
93 |
+
$instance['thumbnail_size'] = strip_tags($new_instance['thumbnail_size']);
|
94 |
|
95 |
return $instance;
|
96 |
}
|
include/lcp_widget_form.php
CHANGED
@@ -27,6 +27,7 @@ $instance = wp_parse_args( (array) $instance, array(
|
|
27 |
'show_excerpt'=>'',
|
28 |
'exclude'=>'',
|
29 |
'excludeposts'=>'',
|
|
|
30 |
'offset'=>'',
|
31 |
'show_catlink'=>'' ) );
|
32 |
$title = strip_tags($instance['title']);
|
@@ -41,7 +42,8 @@ $offset = strip_tags($instance['offset']);
|
|
41 |
$showcatlink = strip_tags($instance['catlink']);
|
42 |
$categoryid = strip_tags($instance['categoryid']);
|
43 |
$showexcerpt = strip_tags($instance['excerpt']);
|
44 |
-
|
|
|
45 |
?>
|
46 |
|
47 |
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e("Title")?></label>
|
@@ -112,23 +114,33 @@ $showexcerpt = strip_tags($instance['excerpt']);
|
|
112 |
value="<?php echo attribute_escape($excludeposts); ?>" />
|
113 |
</p>
|
114 |
|
115 |
-
|
116 |
<label>Show: </label><br/>
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
<
|
123 |
-
|
124 |
-
|
125 |
-
</
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
'show_excerpt'=>'',
|
28 |
'exclude'=>'',
|
29 |
'excludeposts'=>'',
|
30 |
+
'thumbnail' =>'',
|
31 |
'offset'=>'',
|
32 |
'show_catlink'=>'' ) );
|
33 |
$title = strip_tags($instance['title']);
|
42 |
$showcatlink = strip_tags($instance['catlink']);
|
43 |
$categoryid = strip_tags($instance['categoryid']);
|
44 |
$showexcerpt = strip_tags($instance['excerpt']);
|
45 |
+
$thumbnail = strip_tags($instance['thumbnail']);
|
46 |
+
$thumbnail_size = strip_tags($instance['thumbnail_size']);
|
47 |
?>
|
48 |
|
49 |
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e("Title")?></label>
|
114 |
value="<?php echo attribute_escape($excludeposts); ?>" />
|
115 |
</p>
|
116 |
|
117 |
+
|
118 |
<label>Show: </label><br/>
|
119 |
+
<p>
|
120 |
+
<input type="checkbox" <?php checked( (bool) $instance['thumbnail'], true ); ?>
|
121 |
+
name="<?php echo $this->get_field_name( 'thumbnail'); ?>" />Thumbnail - size:
|
122 |
+
<select id="<?php echo $this->get_field_id('thumbnail_size'); ?>"
|
123 |
+
name="<?php echo $this->get_field_name( 'thumbnail_size' ); ?>" type="text">
|
124 |
+
<option value='thumbnail'>thumbnail</option>
|
125 |
+
<option value='medium'>medium</option>
|
126 |
+
<option value='large'>large</option>
|
127 |
+
<option value='full'>full</option>
|
128 |
+
</select>
|
129 |
+
</p>
|
130 |
+
<p>
|
131 |
+
<input type="checkbox" <?php checked( (bool) $instance['show_date'], true ); ?>
|
132 |
+
name="<?php echo $this->get_field_name( 'show_date' ); ?>" />Date
|
133 |
+
</p>
|
134 |
+
<p>
|
135 |
+
<input type="checkbox" <?php checked( (bool) $instance['show_author'], true ); ?>
|
136 |
+
name="<?php echo $this->get_field_name( 'show_author' ); ?>" />Author
|
137 |
+
</p>
|
138 |
+
<p>
|
139 |
+
<input type="checkbox" <?php checked( (bool) $instance['show_catlink'], true ); ?>
|
140 |
+
name="<?php echo $this->get_field_name( 'show_catlink' ); ?>" />Link to category
|
141 |
+
</p>
|
142 |
+
<p>
|
143 |
+
<input type="checkbox" <?php checked( (bool) $instance['show_excerpt'], true ); ?>
|
144 |
+
name="<?php echo $this->get_field_name( 'show_excerpt' ); ?>" />Excerpt
|
145 |
+
</p>
|
146 |
+
|
list_cat_posts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: List category posts
|
4 |
Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
|
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.19
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
3 |
Plugin Name: List category posts
|
4 |
Plugin URI: http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/
|
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.19.1
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
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: 2.8
|
6 |
-
Tested up to: 3.2
|
7 |
-
Stable tag: 0.19
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
|
@@ -147,6 +147,10 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
150 |
= 0.19 =
|
151 |
This update is dedicated to S. Keller from Switzerland who gave me "The Ultimate Hitchhiker's Guide to the Galaxy" from my Amazon Wishlit in appreciation for the plugin. I am really enjoying the read :D. If you
|
152 |
* Fixed private post logic, not displaying post if private. Thanks Bainternet from WordPress Answers: http://wordpress.stackexchange.com/questions/12514/list-category-posts-not-showing-posts-marked-private-to-logged-in-users/12520#12520
|
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: 2.8
|
6 |
+
Tested up to: 3.2.1
|
7 |
+
Stable tag: 0.19.1
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts allows you to list posts from a category into a post/page using the [catlist] shortcode.
|
147 |
|
148 |
== Changelog ==
|
149 |
|
150 |
+
= 0.19.1 =
|
151 |
+
* Added thumbnail to Widget.
|
152 |
+
* Added thumbnail link to post (http://picod.net/33).
|
153 |
+
|
154 |
= 0.19 =
|
155 |
This update is dedicated to S. Keller from Switzerland who gave me "The Ultimate Hitchhiker's Guide to the Galaxy" from my Amazon Wishlit in appreciation for the plugin. I am really enjoying the read :D. If you
|
156 |
* Fixed private post logic, not displaying post if private. Thanks Bainternet from WordPress Answers: http://wordpress.stackexchange.com/questions/12514/list-category-posts-not-showing-posts-marked-private-to-logged-in-users/12520#12520
|