Version Description
- Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.15 |
Comparing to | |
See all releases |
Code changes from version 0.14.1 to 0.15
- list_cat_posts.php +11 -2
- readme.txt +7 -1
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.
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
@@ -56,7 +56,9 @@ function catlist_func($atts, $content = null) {
|
|
56 |
'thumbnail' => 'no',
|
57 |
'post_type' => '',
|
58 |
'post_parent' => '0',
|
59 |
-
'class' => 'lcp_catlist'
|
|
|
|
|
60 |
), $atts);
|
61 |
return list_category_posts($atts);
|
62 |
}
|
@@ -131,9 +133,16 @@ function lcp_category($lcp_category_id, $lcp_category_name, $atts){
|
|
131 |
'&exclude=' . $atts['excludeposts'] .
|
132 |
'&tag=' . $atts['tags'] .
|
133 |
'&offset=' . $atts['offset'];
|
|
|
|
|
134 |
if($atts['post_type']): $lcp_query .= '&post_type=' . $atts['post_type']; endif;
|
135 |
if($atts['post_parent']): $lcp_query .= '&post_parent=' . $atts['post_parent']; endif;
|
136 |
|
|
|
|
|
|
|
|
|
|
|
137 |
return get_posts($lcp_query);
|
138 |
}
|
139 |
|
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.15
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://picandocodigo.net/
|
9 |
*/
|
56 |
'thumbnail' => 'no',
|
57 |
'post_type' => '',
|
58 |
'post_parent' => '0',
|
59 |
+
'class' => 'lcp_catlist',
|
60 |
+
'customfield_name' => '',
|
61 |
+
'customfield_value' =>''
|
62 |
), $atts);
|
63 |
return list_category_posts($atts);
|
64 |
}
|
133 |
'&exclude=' . $atts['excludeposts'] .
|
134 |
'&tag=' . $atts['tags'] .
|
135 |
'&offset=' . $atts['offset'];
|
136 |
+
|
137 |
+
// Post type and post parent:
|
138 |
if($atts['post_type']): $lcp_query .= '&post_type=' . $atts['post_type']; endif;
|
139 |
if($atts['post_parent']): $lcp_query .= '&post_parent=' . $atts['post_parent']; endif;
|
140 |
|
141 |
+
// Custom fields 'customfield_name' & 'customfield_value' should both be defined
|
142 |
+
if($atts['customfield_name']!='' && $atts['customfield_value'] != ''):
|
143 |
+
$lcp_query .= '&meta_key=' . $atts['customfield_name'] . '&meta_value=' . $atts['customfield_value'];
|
144 |
+
endif;
|
145 |
+
|
146 |
return get_posts($lcp_query);
|
147 |
}
|
148 |
|
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: 2.8
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 0.
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts is a simple WordPress plugin which 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.
|
@@ -90,6 +90,9 @@ If you use both arguments (wrong!), List Category Posts will show the posts from
|
|
90 |
|
91 |
* **class** - CSS class for the default UL generated by the plugin.
|
92 |
|
|
|
|
|
|
|
93 |
Your comments and feedback are welcome at: http://foro.picandocodigo.net/categories/list-category-posts
|
94 |
|
95 |
**New Code is welcome too** :D
|
@@ -115,6 +118,9 @@ Template system has changed. Custom templates should be stored in wordpress them
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
118 |
= 0.14.1 =
|
119 |
* Fixed "Show the title of the category with a link to the category" code (catlink param), it broke on some previous update, but now it's working again. Thanks Soccerwidow on the WP Forums for pointing this out.
|
120 |
|
4 |
Tags: list, categories, posts, cms
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 0.15
|
8 |
|
9 |
== Description ==
|
10 |
List Category Posts is a simple WordPress plugin which 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.
|
90 |
|
91 |
* **class** - CSS class for the default UL generated by the plugin.
|
92 |
|
93 |
+
* **custom fields** - To use custom fields, you must specify two values: customfield_name and customfield_value. Using this only show posts that contain a custom field with this name and value. Both parameters must be defined, or neither will work.
|
94 |
+
|
95 |
+
|
96 |
Your comments and feedback are welcome at: http://foro.picandocodigo.net/categories/list-category-posts
|
97 |
|
98 |
**New Code is welcome too** :D
|
118 |
|
119 |
== Changelog ==
|
120 |
|
121 |
+
= 0.15 =
|
122 |
+
* Added custom fields support. Define both custom field (customfield_name) and value (customfield_value) to use it.
|
123 |
+
|
124 |
= 0.14.1 =
|
125 |
* Fixed "Show the title of the category with a link to the category" code (catlink param), it broke on some previous update, but now it's working again. Thanks Soccerwidow on the WP Forums for pointing this out.
|
126 |
|