Version Description
- Fixed multiple CSS classes, things like
[catlist posts_cats=yes posts_cats_class="feed categories"]
now work.
Download this release
Release Info
Developer | fernandobt |
Plugin | List category posts |
Version | 0.86.1 |
Comparing to | |
See all releases |
Code changes from version 0.86 to 0.86.1
- include/lcp-catlist.php +1 -1
- include/lcp-utils.php +11 -0
- include/lcp-wrapper.php +4 -1
- list-category-posts.php +1 -1
- readme.txt +6 -2
include/lcp-catlist.php
CHANGED
@@ -544,7 +544,7 @@ class CatList{
|
|
544 |
$props['start'] = $start;
|
545 |
}
|
546 |
//Give a class to wrapper tag
|
547 |
-
$props['class'] = $css_class;
|
548 |
|
549 |
//Give id to wrapper tag
|
550 |
$props['id'] = 'lcp_instance_' . $this->instance;
|
544 |
$props['start'] = $start;
|
545 |
}
|
546 |
//Give a class to wrapper tag
|
547 |
+
$props['class'] = LcpUtils::sanitize_html_classes($css_class);
|
548 |
|
549 |
//Give id to wrapper tag
|
550 |
$props['id'] = 'lcp_instance_' . $this->instance;
|
include/lcp-utils.php
CHANGED
@@ -58,4 +58,15 @@ class LcpUtils{
|
|
58 |
return $value;
|
59 |
};
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
58 |
return $value;
|
59 |
};
|
60 |
}
|
61 |
+
|
62 |
+
// Adapted from a comment on https://developer.wordpress.org/reference/functions/sanitize_html_class/
|
63 |
+
public static function sanitize_html_classes($classes, $sep = " ") {
|
64 |
+
if(!is_array($classes)) {
|
65 |
+
$classes = explode($sep, $classes);
|
66 |
+
}
|
67 |
+
|
68 |
+
$classes = array_map('sanitize_html_class', $classes);
|
69 |
+
|
70 |
+
return implode(' ', $classes);
|
71 |
+
}
|
72 |
}
|
include/lcp-wrapper.php
CHANGED
@@ -4,6 +4,9 @@
|
|
4 |
* defined by the user, both in shortcode parameters (e.g. comments_tag)
|
5 |
* and in template method calls.
|
6 |
*/
|
|
|
|
|
|
|
7 |
class LcpWrapper {
|
8 |
|
9 |
// Singleton implementation
|
@@ -34,7 +37,7 @@ class LcpWrapper {
|
|
34 |
elseif (!empty($tag) && empty($css_class)) :
|
35 |
return $this->to_html($tag, [], $info);
|
36 |
endif;
|
37 |
-
$css_class =
|
38 |
return $this->to_html($tag, ['class' => $css_class], $info);
|
39 |
endif;
|
40 |
}
|
4 |
* defined by the user, both in shortcode parameters (e.g. comments_tag)
|
5 |
* and in template method calls.
|
6 |
*/
|
7 |
+
|
8 |
+
require_once 'lcp-utils.php';
|
9 |
+
|
10 |
class LcpWrapper {
|
11 |
|
12 |
// Singleton implementation
|
37 |
elseif (!empty($tag) && empty($css_class)) :
|
38 |
return $this->to_html($tag, [], $info);
|
39 |
endif;
|
40 |
+
$css_class = LcpUtils::sanitize_html_classes($css_class);
|
41 |
return $this->to_html($tag, ['class' => $css_class], $info);
|
42 |
endif;
|
43 |
}
|
list-category-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 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.86
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://fernandobriano.com
|
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 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.86.1
|
7 |
Author: Fernando Briano
|
8 |
Author URI: http://fernandobriano.com
|
9 |
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: fernandobt, zymeth25
|
|
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: 5.
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 0.86
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -237,6 +237,10 @@ Template system has changed. Custom templates should be stored in WordPress them
|
|
237 |
|
238 |
== Changelog ==
|
239 |
|
|
|
|
|
|
|
|
|
240 |
= 0.86 =
|
241 |
|
242 |
* **New feature**: use `link_current=no` to prevent the current post from being wrapped in a link.
|
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: 5.9
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 0.86.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
237 |
|
238 |
== Changelog ==
|
239 |
|
240 |
+
= 0.86.1 =
|
241 |
+
|
242 |
+
* Fixed multiple CSS classes, things like `[catlist posts_cats=yes posts_cats_class="feed categories"]` now work.
|
243 |
+
|
244 |
= 0.86 =
|
245 |
|
246 |
* **New feature**: use `link_current=no` to prevent the current post from being wrapped in a link.
|