Version Description
- Vagrant box and development environment improved by bibz
- Tested with WordPress 4.3, updated Widget constructor because of PHP 4 deprecation.
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.63 |
Comparing to | |
See all releases |
Code changes from version 0.62 to 0.63
- include/lcp-widget.php +1 -1
- list-category-posts.php +178 -0
- readme.txt +7 -2
include/lcp-widget.php
CHANGED
@@ -9,7 +9,7 @@ class ListCategoryPostsWidget extends WP_Widget{
|
|
9 |
|
10 |
function ListCategoryPostsWidget() {
|
11 |
$opts = array('description' => __('List posts from a specified category','list-category-posts') );
|
12 |
-
parent::
|
13 |
}
|
14 |
|
15 |
function widget($args, $instance) {
|
9 |
|
10 |
function ListCategoryPostsWidget() {
|
11 |
$opts = array('description' => __('List posts from a specified category','list-category-posts') );
|
12 |
+
parent::__construct(false, $name = __('List Category Posts','list-category-posts'), $opts);
|
13 |
}
|
14 |
|
15 |
function widget($args, $instance) {
|
list-category-posts.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
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 by category in 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, the number of posts to display and many more parameters. You can use [catlist] as many times as needed with different arguments. Usage: [catlist argument1=value1 argument2=value2].
|
6 |
+
Version: 0.63
|
7 |
+
Author: Fernando Briano
|
8 |
+
Author URI: http://fernandobriano.com
|
9 |
+
|
10 |
+
Text Domain: list-category-posts
|
11 |
+
Domain Path: /languages/
|
12 |
+
|
13 |
+
Copyright 2008-2015 Fernando Briano (email : fernando@picandocodigo.net)
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 3 of the License, or
|
18 |
+
any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program; if not, write to the Free Software
|
27 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
28 |
+
*/
|
29 |
+
|
30 |
+
|
31 |
+
include 'include/lcp-widget.php';
|
32 |
+
include 'include/lcp-options.php';
|
33 |
+
require_once 'include/lcp-catlistdisplayer.php';
|
34 |
+
|
35 |
+
class ListCategoryPosts{
|
36 |
+
/**
|
37 |
+
* Gets the shortcode parameters and instantiate plugin objects
|
38 |
+
* @param $atts
|
39 |
+
* @param $content
|
40 |
+
*/
|
41 |
+
static function catlist_func($atts, $content = null) {
|
42 |
+
$atts = shortcode_atts(array(
|
43 |
+
'id' => '0',
|
44 |
+
'name' => '',
|
45 |
+
'orderby' => 'date',
|
46 |
+
'order' => 'desc',
|
47 |
+
'numberposts' => '',
|
48 |
+
'date' => 'no',
|
49 |
+
'date_tag' => '',
|
50 |
+
'date_class' =>'',
|
51 |
+
'dateformat' => get_option('date_format'),
|
52 |
+
'date_modified' => '',
|
53 |
+
'date_modified_tag' => '',
|
54 |
+
'date_modified_class' => '',
|
55 |
+
'author' => 'no',
|
56 |
+
'author_posts_link' => 'no',
|
57 |
+
'author_tag' =>'',
|
58 |
+
'author_class' => '',
|
59 |
+
'author_posts' => '',
|
60 |
+
'template' => '',
|
61 |
+
'excerpt' => 'no',
|
62 |
+
'excerpt_size' => '55',
|
63 |
+
'excerpt_strip' => 'yes',
|
64 |
+
'excerpt_overwrite' => 'no',
|
65 |
+
'excerpt_tag' =>'',
|
66 |
+
'excerpt_class' =>'',
|
67 |
+
'exclude' => '0',
|
68 |
+
'excludeposts' => '0',
|
69 |
+
'offset' => '0',
|
70 |
+
'tags' => '',
|
71 |
+
'exclude_tags' => '',
|
72 |
+
'currenttags' => '',
|
73 |
+
'content' => 'no',
|
74 |
+
'content_tag' => '',
|
75 |
+
'content_class' => '',
|
76 |
+
'display_id' => 'no',
|
77 |
+
'catlink' => 'no',
|
78 |
+
'catname' => 'no',
|
79 |
+
'catlink_string' => '',
|
80 |
+
'catlink_tag' =>'',
|
81 |
+
'catlink_class' => '',
|
82 |
+
'comments' => 'no',
|
83 |
+
'comments_tag' => '',
|
84 |
+
'comments_class' => '',
|
85 |
+
'starting_with' => '',
|
86 |
+
'thumbnail' => 'no',
|
87 |
+
'thumbnail_size' => 'thumbnail',
|
88 |
+
'thumbnail_class' => '',
|
89 |
+
'title_tag' => '',
|
90 |
+
'title_class' => '',
|
91 |
+
'title_limit' => '0',
|
92 |
+
'post_type' => '',
|
93 |
+
'post_status' => '',
|
94 |
+
'post_parent' => '0',
|
95 |
+
'post_suffix' => '',
|
96 |
+
'show_protected' => 'no',
|
97 |
+
'class' => 'lcp_catlist',
|
98 |
+
'customfield_name' => '',
|
99 |
+
'customfield_value' =>'',
|
100 |
+
'customfield_display' =>'',
|
101 |
+
'customfield_display_name' =>'',
|
102 |
+
'customfield_orderby' =>'',
|
103 |
+
'customfield_tag' => '',
|
104 |
+
'customfield_class' => '',
|
105 |
+
'taxonomy' => '',
|
106 |
+
'categorypage' => '',
|
107 |
+
'category_count' => '',
|
108 |
+
'morelink' => '',
|
109 |
+
'morelink_class' => '',
|
110 |
+
'morelink_tag' => '',
|
111 |
+
'posts_morelink' => '',
|
112 |
+
'posts_morelink_class' => '',
|
113 |
+
'year' => '',
|
114 |
+
'monthnum' => '',
|
115 |
+
'search' => '',
|
116 |
+
'link_target' => '',
|
117 |
+
'pagination' => 'no',
|
118 |
+
'pagination_next' => '>>',
|
119 |
+
'pagination_prev' => '<<',
|
120 |
+
'no_posts_text' => "",
|
121 |
+
'instance' => '0',
|
122 |
+
'no_post_titles' => 'no',
|
123 |
+
'link_titles' => true
|
124 |
+
), $atts);
|
125 |
+
if( $atts['numberposts'] == ''){
|
126 |
+
$atts['numberposts'] = get_option('numberposts');
|
127 |
+
}
|
128 |
+
if( $atts['pagination'] == 'yes'){
|
129 |
+
lcp_pagination_css();
|
130 |
+
}
|
131 |
+
$catlist_displayer = new CatListDisplayer($atts);
|
132 |
+
return $catlist_displayer->display();
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
|
137 |
+
|
138 |
+
function lpc_meta($links, $file) {
|
139 |
+
$plugin = plugin_basename(__FILE__);
|
140 |
+
|
141 |
+
if ($file == $plugin):
|
142 |
+
return array_merge(
|
143 |
+
$links,
|
144 |
+
array( sprintf('<a href="http://wordpress.org/extend/plugins/list-category-posts/other_notes/">%s</a>', __('How to use','list-category-posts')) ),
|
145 |
+
array( sprintf('<a href="http://picandocodigo.net/programacion/wordpress/list-category-posts-wordpress-plugin-english/#support">%s</a>', __('Donate','list-category-posts')) ),
|
146 |
+
array( sprintf('<a href="https://github.com/picandocodigo/List-Category-Posts">%s</a>', __('Fork on Github','list-category-posts')) )
|
147 |
+
);
|
148 |
+
endif;
|
149 |
+
|
150 |
+
return $links;
|
151 |
+
}
|
152 |
+
|
153 |
+
add_filter( 'plugin_row_meta', 'lpc_meta', 10, 2 );
|
154 |
+
|
155 |
+
function load_i18n(){
|
156 |
+
load_plugin_textdomain( 'list-category-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
157 |
+
}
|
158 |
+
add_action( 'plugins_loaded', 'load_i18n' );
|
159 |
+
|
160 |
+
function lcp_pagination_css(){
|
161 |
+
if ( @file_exists( get_stylesheet_directory() . '/lcp_paginator.css' ) ):
|
162 |
+
$css_file = get_stylesheet_directory_uri() . '/lcp_paginator.css';
|
163 |
+
elseif ( @file_exists( get_template_directory() . '/lcp_paginator.css' ) ):
|
164 |
+
$css_file = get_template_directory_uri() . '/lcp_paginator.css';
|
165 |
+
else:
|
166 |
+
$css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css';
|
167 |
+
endif;
|
168 |
+
|
169 |
+
wp_enqueue_style( 'lcp_paginator', $css_file);
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* TO-DO:
|
174 |
+
- Pagination * DONE - Need to add "page" text
|
175 |
+
- Add Older Posts at bottom of List Category Post page
|
176 |
+
- Simpler template system
|
177 |
+
- Exclude child categories
|
178 |
+
*/
|
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: 4.
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -451,6 +451,11 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
451 |
|
452 |
== Changelog ==
|
453 |
|
|
|
|
|
|
|
|
|
|
|
454 |
= 0.62 =
|
455 |
|
456 |
* Dutch translation by Gerhard Hoogterp, thank you!
|
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: 4.3
|
7 |
+
Stable tag: 0.63
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
451 |
|
452 |
== Changelog ==
|
453 |
|
454 |
+
= 0.63 =
|
455 |
+
|
456 |
+
* Vagrant box and development environment improved by bibz
|
457 |
+
* Tested with WordPress 4.3, updated Widget constructor because of [PHP 4 deprecation](https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/).
|
458 |
+
|
459 |
= 0.62 =
|
460 |
|
461 |
* Dutch translation by Gerhard Hoogterp, thank you!
|