Version Description
- October 10th 2017 =
- Add option to filter by post status
- Fixed footer section do not change when switching to and from "all posts"
Download this release
Release Info
Developer | Kometschuh |
Plugin | Category Posts Widget |
Version | 4.7.3 |
Comparing to | |
See all releases |
Code changes from version 4.7.2 to 4.7.3
- cat-posts.php +86 -51
- js/admin/category-posts-widget.js +9 -8
- readme.txt +7 -2
cat-posts.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Category Posts Widget
|
|
4 |
Plugin URI: https://wordpress.org/plugins/category-posts/
|
5 |
Description: Adds a widget that shows the most recent posts from a single category.
|
6 |
Author: TipTopPress
|
7 |
-
Version: 4.7.
|
8 |
Author URI: http://tiptoppress.com
|
9 |
Text Domain: category-posts
|
10 |
Domain Path: /languages
|
@@ -15,7 +15,7 @@ namespace categoryPosts;
|
|
15 |
// Don't call the file directly
|
16 |
if ( !defined( 'ABSPATH' ) ) exit;
|
17 |
|
18 |
-
const CAT_POST_VERSION = "4.7.
|
19 |
const CAT_POST_DOC_URL = "http://tiptoppress.com/category-posts-widget/documentation-4-7?utm_source=widget_cpw&utm_campaign=documentation_4_7_cpw&utm_medium=form";
|
20 |
|
21 |
const SHORTCODE_NAME = 'catposts';
|
@@ -37,12 +37,12 @@ function wp_admin_bar_customize_menu() {
|
|
37 |
return;
|
38 |
|
39 |
$current_url = "";
|
40 |
-
if ( isset($_GET['post'])
|
41 |
$current_url = get_permalink( $_GET['post'] );
|
42 |
$customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );
|
43 |
|
44 |
-
$p
|
45 |
-
$names = shortcode_names(SHORTCODE_NAME
|
46 |
if( empty($names) )
|
47 |
return;
|
48 |
|
@@ -505,7 +505,7 @@ class Widget extends \WP_Widget {
|
|
505 |
$title_args = array('echo'=>false);
|
506 |
|
507 |
if ($no_link)
|
508 |
-
$ret .= '<span '.$class
|
509 |
else
|
510 |
$ret .= '<a '.$class . ' href="'.get_the_permalink().'" title="'.the_title_attribute($title_args).'">';
|
511 |
|
@@ -542,6 +542,18 @@ class Widget extends \WP_Widget {
|
|
542 |
'orderby' => $sort_by,
|
543 |
'order' => $sort_order
|
544 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
|
546 |
if (isset($instance["num"]))
|
547 |
$args['showposts'] = (int) $instance["num"];
|
@@ -639,32 +651,40 @@ class Widget extends \WP_Widget {
|
|
639 |
function footerHTML($instance) {
|
640 |
|
641 |
$ret = "";
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
|
|
|
|
|
|
|
|
663 |
}
|
664 |
}
|
|
|
|
|
|
|
|
|
665 |
return $ret;
|
666 |
}
|
667 |
-
|
668 |
/**
|
669 |
* Calculate the HTML for a post item based on the widget settings and post.
|
670 |
* Expected to be called in an active loop with all the globals set
|
@@ -1023,6 +1043,7 @@ class Widget extends \WP_Widget {
|
|
1023 |
'num' => get_option('posts_per_page'),
|
1024 |
'offset' => 1,
|
1025 |
'sort_by' => '',
|
|
|
1026 |
'asc_sort_order' => '',
|
1027 |
'exclude_current_post' => '',
|
1028 |
'hideNoThumb' => '',
|
@@ -1032,6 +1053,7 @@ class Widget extends \WP_Widget {
|
|
1032 |
$num = $instance['num'];
|
1033 |
$offset = $instance['offset'];
|
1034 |
$sort_by = $instance['sort_by'];
|
|
|
1035 |
$asc_sort_order = $instance['asc_sort_order'];
|
1036 |
$exclude_current_post = $instance['exclude_current_post'];
|
1037 |
$hideNoThumb = $instance['hideNoThumb'];
|
@@ -1063,6 +1085,16 @@ class Widget extends \WP_Widget {
|
|
1063 |
<input style="text-align: center; width: 30%;" id="<?php echo $this->get_field_id("offset"); ?>" name="<?php echo $this->get_field_name("offset"); ?>" type="number" min="1" value="<?php echo absint($instance["offset"]); ?>" />
|
1064 |
</label>
|
1065 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1066 |
<p>
|
1067 |
<label for="<?php echo $this->get_field_id("sort_by"); ?>">
|
1068 |
<?php _e('Sort by','category-posts'); ?>:
|
@@ -1386,7 +1418,7 @@ class Widget extends \WP_Widget {
|
|
1386 |
<input class="widefat" style="width:60%;" placeholder="<?php _e('... more by this topic','category-posts')?>" id="<?php echo $this->get_field_id("footer_link_text"); ?>" name="<?php echo $this->get_field_name("footer_link_text"); ?>" type="text" value="<?php echo esc_attr($instance["footer_link_text"]); ?>" />
|
1387 |
</label>
|
1388 |
</p>
|
1389 |
-
<p class="categoryposts-data-panel-footer-footerLink"
|
1390 |
<label for="<?php echo $this->get_field_id("footer_link"); ?>">
|
1391 |
<?php _e( 'Footer link URL','category-posts' ); ?>:
|
1392 |
<input class="widefat" style="width:60%;" placeholder="<?php _e('... URL of more link','category-posts')?>" id="<?php echo $this->get_field_id("footer_link"); ?>" name="<?php echo $this->get_field_name("footer_link"); ?>" type="text" value="<?php echo esc_attr($instance["footer_link"]); ?>" />
|
@@ -1637,6 +1669,7 @@ function default_settings() {
|
|
1637 |
'num' => get_option('posts_per_page'),
|
1638 |
'offset' => 1,
|
1639 |
'sort_by' => 'date',
|
|
|
1640 |
'asc_sort_order' => false,
|
1641 |
'exclude_current_post' => false,
|
1642 |
'hideNoThumb' => false,
|
@@ -1986,14 +2019,14 @@ function show_user_profile( $user ) {
|
|
1986 |
<tr>
|
1987 |
<th><label for="<?php echo __NAMESPACE__?>[panels]"><?php _e('Open panels behavior','category-posts')?></label></th>
|
1988 |
<td>
|
1989 |
-
<input type="checkbox" name="<?php echo __NAMESPACE__?>[panels]" id="<?php echo __NAMESPACE__?>[panels]" <?php checked($accordion);
|
1990 |
<label for=<?php echo __NAMESPACE__?>[panels]><?php _e('Close the curremtly open panel when opening a new one','category-posts')?></label>
|
1991 |
</td>
|
1992 |
</tr>
|
1993 |
<tr>
|
1994 |
<th><label for="<?php echo __NAMESPACE__?>[editor]"><?php _e('Visual editor button','category-posts')?></label></th>
|
1995 |
<td>
|
1996 |
-
<input type="checkbox" name="<?php echo __NAMESPACE__?>[editor]" id="<?php echo __NAMESPACE__?>[editor]" <?php checked($editor);
|
1997 |
<label for="<?php echo __NAMESPACE__?>[editor]"><?php _e('Hide the "insert shortcode" button from the editor','category-posts')?></label>
|
1998 |
</td>
|
1999 |
</tr>
|
@@ -2106,20 +2139,8 @@ class virtualWidget {
|
|
2106 |
if (!$is_shortcode)
|
2107 |
$widget_id .= '-internal';
|
2108 |
|
2109 |
-
if (!(isset($settings['
|
2110 |
-
|
2111 |
-
'.cat-post-item img {max-width: initial; max-height: initial;}',
|
2112 |
-
'.cat-post-title {font-size: 15px;}',
|
2113 |
-
'.cat-post-current .cat-post-title {font-weight: bold; text-transform: uppercase;}',
|
2114 |
-
'.cat-post-date {font-size: 12px; line-height: 18px; font-style: italic; margin-bottom: 10px;}',
|
2115 |
-
'.cat-post-comment-num {font-size: 12px; line-height: 18px;}',
|
2116 |
-
'.cat-post-author {margin-bottom: 0;}',
|
2117 |
-
'.cat-post-thumbnail {margin: 5px 10px 5px 0; display: block;}',
|
2118 |
-
'.cat-post-item:before {content: ""; display: table; clear: both;}',
|
2119 |
-
'.cat-post-item:after {content: ""; display: table; clear: both;}',
|
2120 |
-
'.cat-post-item img {margin: initial;}',
|
2121 |
-
);
|
2122 |
-
} else {
|
2123 |
$rules = array( // rules that should be applied to all widgets
|
2124 |
'.cat-post-item img {max-width: initial; max-height: initial;}',
|
2125 |
'.cat-post-current .cat-post-title {text-transform: uppercase;}',
|
@@ -2127,12 +2148,18 @@ class virtualWidget {
|
|
2127 |
'.cat-post-author {margin-bottom: 0;}',
|
2128 |
'.cat-post-thumbnail {margin: 5px 10px 5px 0; display: block;}',
|
2129 |
'.cat-post-item:before {content: ""; display: table; clear: both;}',
|
2130 |
-
'.cat-post-item:after {content: ""; display: table; clear: both;}',
|
2131 |
'.cat-post-item img {margin: initial;}',
|
2132 |
);
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2136 |
|
2137 |
/*
|
2138 |
the twenty seventeen theme have a border between the LI elements of a widget,
|
@@ -2171,8 +2198,13 @@ class virtualWidget {
|
|
2171 |
}
|
2172 |
}
|
2173 |
|
|
|
|
|
2174 |
if (isset( $settings['everything_is_link'] ) && $settings['everything_is_link']) {
|
2175 |
$rules[] = '.cat-post-everything-is-link { }';
|
|
|
|
|
|
|
2176 |
}
|
2177 |
|
2178 |
foreach ($rules as $rule) {
|
@@ -2191,7 +2223,10 @@ class virtualWidget {
|
|
2191 |
}
|
2192 |
|
2193 |
if ((isset($settings['use_css_cropping']) && $settings['use_css_cropping']) || !(isset($settings['disable_css']) && $settings['disable_css'])) {
|
2194 |
-
$
|
|
|
|
|
|
|
2195 |
$ret[] = '#'.$widget_id.' .cat-post-item img {margin: initial;}';
|
2196 |
}
|
2197 |
}
|
@@ -2303,4 +2338,4 @@ add_action('wp_loaded',__NAMESPACE__.'\wp_loaded');
|
|
2303 |
function wp_loaded() {
|
2304 |
register_meta('post', SHORTCODE_META,null,'__return_false'); // do not allow access to the shortcode meta
|
2305 |
// use the pre 4.6 format for backward compatibility
|
2306 |
-
}
|
4 |
Plugin URI: https://wordpress.org/plugins/category-posts/
|
5 |
Description: Adds a widget that shows the most recent posts from a single category.
|
6 |
Author: TipTopPress
|
7 |
+
Version: 4.7.3
|
8 |
Author URI: http://tiptoppress.com
|
9 |
Text Domain: category-posts
|
10 |
Domain Path: /languages
|
15 |
// Don't call the file directly
|
16 |
if ( !defined( 'ABSPATH' ) ) exit;
|
17 |
|
18 |
+
const CAT_POST_VERSION = "4.7.3";
|
19 |
const CAT_POST_DOC_URL = "http://tiptoppress.com/category-posts-widget/documentation-4-7?utm_source=widget_cpw&utm_campaign=documentation_4_7_cpw&utm_medium=form";
|
20 |
|
21 |
const SHORTCODE_NAME = 'catposts';
|
37 |
return;
|
38 |
|
39 |
$current_url = "";
|
40 |
+
if ( isset( $_GET['post'] ) && $_GET['post'] !== '' )
|
41 |
$current_url = get_permalink( $_GET['post'] );
|
42 |
$customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );
|
43 |
|
44 |
+
$p = isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ? get_post( $_GET['post']) : false;
|
45 |
+
$names = $p ? shortcode_names( SHORTCODE_NAME, $p->post_content ) : array();
|
46 |
if( empty($names) )
|
47 |
return;
|
48 |
|
505 |
$title_args = array('echo'=>false);
|
506 |
|
507 |
if ($no_link)
|
508 |
+
$ret .= '<span '.$class.'>';
|
509 |
else
|
510 |
$ret .= '<a '.$class . ' href="'.get_the_permalink().'" title="'.the_title_attribute($title_args).'">';
|
511 |
|
542 |
'orderby' => $sort_by,
|
543 |
'order' => $sort_order
|
544 |
);
|
545 |
+
|
546 |
+
$valid_status = array('publish', 'future', 'both');
|
547 |
+
if ( isset($instance['status']) && in_array($instance['status'],$valid_status) ) {
|
548 |
+
$status = $instance['status'];
|
549 |
+
if ($status == 'both') {
|
550 |
+
$args['post_status'] = array('publish', 'future');
|
551 |
+
} else {
|
552 |
+
$args['post_status'] = $status;
|
553 |
+
}
|
554 |
+
} else {
|
555 |
+
$args['post_status'] = 'publish';
|
556 |
+
}
|
557 |
|
558 |
if (isset($instance["num"]))
|
559 |
$args['showposts'] = (int) $instance["num"];
|
651 |
function footerHTML($instance) {
|
652 |
|
653 |
$ret = "";
|
654 |
+
$url = '';
|
655 |
+
$text = '';
|
656 |
+
|
657 |
+
if (isset ( $instance["footer_link"] ))
|
658 |
+
$url = $instance["footer_link"];
|
659 |
+
|
660 |
+
if (isset ( $instance["footer_link_text"] ))
|
661 |
+
$text = $instance["footer_link_text"];
|
662 |
+
|
663 |
+
// if url is set, but no text, just use the url as text
|
664 |
+
if (empty($text) && !empty($url))
|
665 |
+
$text = $url;
|
666 |
+
|
667 |
+
// if no url is set but just text, assume the url should be to the relevant archive page
|
668 |
+
// category archive for categories filter and home page or blog page when "all categories"
|
669 |
+
// is used
|
670 |
+
if (!empty($text) && empty($url)) {
|
671 |
+
if (isset($instance["cat"]) && ($instance["cat"] != 0) && (get_category($instance["cat"]) != null) )
|
672 |
+
$url = get_category_link($instance["cat"]);
|
673 |
+
else {
|
674 |
+
$blog_page = get_option('page_for_posts');
|
675 |
+
if ($blog_page)
|
676 |
+
$url = get_permalink($blog_page);
|
677 |
+
else
|
678 |
+
$url = home_url();
|
679 |
}
|
680 |
}
|
681 |
+
|
682 |
+
if (!empty($url))
|
683 |
+
$ret .= '<a class="cat-post-footer-link" href="' . esc_url($url) . '">' . esc_html($text) . '</a>';
|
684 |
+
|
685 |
return $ret;
|
686 |
}
|
687 |
+
|
688 |
/**
|
689 |
* Calculate the HTML for a post item based on the widget settings and post.
|
690 |
* Expected to be called in an active loop with all the globals set
|
1043 |
'num' => get_option('posts_per_page'),
|
1044 |
'offset' => 1,
|
1045 |
'sort_by' => '',
|
1046 |
+
'status' => '',
|
1047 |
'asc_sort_order' => '',
|
1048 |
'exclude_current_post' => '',
|
1049 |
'hideNoThumb' => '',
|
1053 |
$num = $instance['num'];
|
1054 |
$offset = $instance['offset'];
|
1055 |
$sort_by = $instance['sort_by'];
|
1056 |
+
$status = $instance['status'];
|
1057 |
$asc_sort_order = $instance['asc_sort_order'];
|
1058 |
$exclude_current_post = $instance['exclude_current_post'];
|
1059 |
$hideNoThumb = $instance['hideNoThumb'];
|
1085 |
<input style="text-align: center; width: 30%;" id="<?php echo $this->get_field_id("offset"); ?>" name="<?php echo $this->get_field_name("offset"); ?>" type="number" min="1" value="<?php echo absint($instance["offset"]); ?>" />
|
1086 |
</label>
|
1087 |
</p>
|
1088 |
+
<p>
|
1089 |
+
<label for="<?php echo $this->get_field_id("status"); ?>">
|
1090 |
+
<?php _e('Status','category-posts'); ?>:
|
1091 |
+
<select id="<?php echo $this->get_field_id("status"); ?>" name="<?php echo $this->get_field_name("status"); ?>">
|
1092 |
+
<option value="publish"<?php selected( $instance["status"], "publish" ); ?>><?php _e('Published','category-posts')?></option>
|
1093 |
+
<option value="future"<?php selected( $instance["status"], "future" ); ?>><?php _e('Scheduled','category-posts')?></option>
|
1094 |
+
<option value="both"<?php selected( $instance["status"], "both" ); ?>><?php _e('Published & Scheduled','category-posts')?></option>
|
1095 |
+
</select>
|
1096 |
+
</label>
|
1097 |
+
</p>
|
1098 |
<p>
|
1099 |
<label for="<?php echo $this->get_field_id("sort_by"); ?>">
|
1100 |
<?php _e('Sort by','category-posts'); ?>:
|
1418 |
<input class="widefat" style="width:60%;" placeholder="<?php _e('... more by this topic','category-posts')?>" id="<?php echo $this->get_field_id("footer_link_text"); ?>" name="<?php echo $this->get_field_name("footer_link_text"); ?>" type="text" value="<?php echo esc_attr($instance["footer_link_text"]); ?>" />
|
1419 |
</label>
|
1420 |
</p>
|
1421 |
+
<p class="categoryposts-data-panel-footer-footerLink">
|
1422 |
<label for="<?php echo $this->get_field_id("footer_link"); ?>">
|
1423 |
<?php _e( 'Footer link URL','category-posts' ); ?>:
|
1424 |
<input class="widefat" style="width:60%;" placeholder="<?php _e('... URL of more link','category-posts')?>" id="<?php echo $this->get_field_id("footer_link"); ?>" name="<?php echo $this->get_field_name("footer_link"); ?>" type="text" value="<?php echo esc_attr($instance["footer_link"]); ?>" />
|
1669 |
'num' => get_option('posts_per_page'),
|
1670 |
'offset' => 1,
|
1671 |
'sort_by' => 'date',
|
1672 |
+
'status' => 'publish',
|
1673 |
'asc_sort_order' => false,
|
1674 |
'exclude_current_post' => false,
|
1675 |
'hideNoThumb' => false,
|
2019 |
<tr>
|
2020 |
<th><label for="<?php echo __NAMESPACE__?>[panels]"><?php _e('Open panels behavior','category-posts')?></label></th>
|
2021 |
<td>
|
2022 |
+
<input type="checkbox" name="<?php echo __NAMESPACE__?>[panels]" id="<?php echo __NAMESPACE__?>[panels]" <?php checked($accordion); ?>>
|
2023 |
<label for=<?php echo __NAMESPACE__?>[panels]><?php _e('Close the curremtly open panel when opening a new one','category-posts')?></label>
|
2024 |
</td>
|
2025 |
</tr>
|
2026 |
<tr>
|
2027 |
<th><label for="<?php echo __NAMESPACE__?>[editor]"><?php _e('Visual editor button','category-posts')?></label></th>
|
2028 |
<td>
|
2029 |
+
<input type="checkbox" name="<?php echo __NAMESPACE__?>[editor]" id="<?php echo __NAMESPACE__?>[editor]" <?php checked($editor); ?>>
|
2030 |
<label for="<?php echo __NAMESPACE__?>[editor]"><?php _e('Hide the "insert shortcode" button from the editor','category-posts')?></label>
|
2031 |
</td>
|
2032 |
</tr>
|
2139 |
if (!$is_shortcode)
|
2140 |
$widget_id .= '-internal';
|
2141 |
|
2142 |
+
if (!(isset($settings['disable_css']) && $settings['disable_css'])) { // checks if css disable is not set
|
2143 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2144 |
$rules = array( // rules that should be applied to all widgets
|
2145 |
'.cat-post-item img {max-width: initial; max-height: initial;}',
|
2146 |
'.cat-post-current .cat-post-title {text-transform: uppercase;}',
|
2148 |
'.cat-post-author {margin-bottom: 0;}',
|
2149 |
'.cat-post-thumbnail {margin: 5px 10px 5px 0; display: block;}',
|
2150 |
'.cat-post-item:before {content: ""; display: table; clear: both;}',
|
|
|
2151 |
'.cat-post-item img {margin: initial;}',
|
2152 |
);
|
2153 |
+
|
2154 |
+
if (!(isset($settings['disable_font_styles']) && $settings['disable_font_styles'])) { // checks if disable font styles is not set
|
2155 |
+
// add general rules which apply to font styling
|
2156 |
+
$rules[] = '.cat-post-title {font-size: 15px;}';
|
2157 |
+
$rules[] = '.cat-post-current .cat-post-title {font-weight: bold; text-transform: uppercase;}';
|
2158 |
+
$rules[] = '.cat-post-date {font-size: 12px; line-height: 18px; font-style: italic; margin-bottom: 10px;}';
|
2159 |
+
$rules[] = '.cat-post-comment-num {font-size: 12px; line-height: 18px;}';
|
2160 |
+
} else {
|
2161 |
+
$rules[] = '.cat-post-date {margin-bottom: 10px;}';
|
2162 |
+
}
|
2163 |
|
2164 |
/*
|
2165 |
the twenty seventeen theme have a border between the LI elements of a widget,
|
2198 |
}
|
2199 |
}
|
2200 |
|
2201 |
+
// everything link related styling
|
2202 |
+
// if we are dealing with "everything is a link" option, we need to add the clear:both to the a element, not the div
|
2203 |
if (isset( $settings['everything_is_link'] ) && $settings['everything_is_link']) {
|
2204 |
$rules[] = '.cat-post-everything-is-link { }';
|
2205 |
+
$rules[] = '.cat-post-item a:after {content: ""; display: table; clear: both;}';
|
2206 |
+
} else {
|
2207 |
+
$rules[] = '.cat-post-item:after {content: ""; display: table; clear: both;}';
|
2208 |
}
|
2209 |
|
2210 |
foreach ($rules as $rule) {
|
2223 |
}
|
2224 |
|
2225 |
if ((isset($settings['use_css_cropping']) && $settings['use_css_cropping']) || !(isset($settings['disable_css']) && $settings['disable_css'])) {
|
2226 |
+
if (isset($settings['use_css_cropping']) && $settings['use_css_cropping'])
|
2227 |
+
$ret[] = '#'.$widget_id.' .cat-post-crop {overflow: hidden; display:block}';
|
2228 |
+
else
|
2229 |
+
$ret[] = '#'.$widget_id.' .cat-post-thumbnail span {overflow: hidden; display:block}';
|
2230 |
$ret[] = '#'.$widget_id.' .cat-post-item img {margin: initial;}';
|
2231 |
}
|
2232 |
}
|
2338 |
function wp_loaded() {
|
2339 |
register_meta('post', SHORTCODE_META,null,'__return_false'); // do not allow access to the shortcode meta
|
2340 |
// use the pre 4.6 format for backward compatibility
|
2341 |
+
}
|
js/admin/category-posts-widget.js
CHANGED
@@ -58,14 +58,16 @@
|
|
58 |
},
|
59 |
|
60 |
// Show hide foote link URL
|
61 |
-
|
62 |
var cat = jQuery(item).find("option:selected").attr('value');
|
63 |
var panel = item.parentElement.parentElement.parentElement.parentElement;
|
64 |
if(cat == '0') {
|
65 |
-
|
|
|
66 |
}
|
67 |
else {
|
68 |
-
|
|
|
69 |
}
|
70 |
},
|
71 |
|
@@ -151,7 +153,7 @@ jQuery(document).ready( function () {
|
|
151 |
jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
|
152 |
cwp_namespace.removeDefaultThumbnailSelection(this);
|
153 |
});
|
154 |
-
|
155 |
var id = jQuery(element).attr('id');
|
156 |
if (cwp_namespace.open_panels.hasOwnProperty(id)) {
|
157 |
var o = cwp_namespace.open_panels[id];
|
@@ -169,10 +171,9 @@ jQuery(document).ready( function () {
|
|
169 |
jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
|
170 |
cwp_namespace.removeDefaultThumbnailSelection(this);
|
171 |
});
|
172 |
-
|
173 |
-
jQuery('.categoryposts-data-panel-filter-cat').on('change', function () { //
|
174 |
-
cwp_namespace.
|
175 |
});
|
176 |
-
|
177 |
});
|
178 |
|
58 |
},
|
59 |
|
60 |
// Show hide foote link URL
|
61 |
+
toggleCatSelection: function(item) {
|
62 |
var cat = jQuery(item).find("option:selected").attr('value');
|
63 |
var panel = item.parentElement.parentElement.parentElement.parentElement;
|
64 |
if(cat == '0') {
|
65 |
+
jQuery(panel).find('.categoryPosts-title_link').hide();
|
66 |
+
jQuery(panel).find('.categoryPosts-title_link_url').show();
|
67 |
}
|
68 |
else {
|
69 |
+
jQuery(panel).find('.categoryPosts-title_link').show();
|
70 |
+
jQuery(panel).find('.categoryPosts-title_link_url').hide();
|
71 |
}
|
72 |
},
|
73 |
|
153 |
jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
|
154 |
cwp_namespace.removeDefaultThumbnailSelection(this);
|
155 |
});
|
156 |
+
// refresh panels to state before the refresh
|
157 |
var id = jQuery(element).attr('id');
|
158 |
if (cwp_namespace.open_panels.hasOwnProperty(id)) {
|
159 |
var o = cwp_namespace.open_panels[id];
|
171 |
jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
|
172 |
cwp_namespace.removeDefaultThumbnailSelection(this);
|
173 |
});
|
174 |
+
|
175 |
+
jQuery('.categoryposts-data-panel-filter-cat').on('change', function () { // change category filter
|
176 |
+
cwp_namespace.toggleCatSelection(this);
|
177 |
});
|
|
|
178 |
});
|
179 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: mark-k, kometschuh, mkrdip
|
|
3 |
Donate link: http://mkrdip.me/donate
|
4 |
Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 4.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -50,6 +50,7 @@ We've also started creating free widget extensions for the Premium Widget. The f
|
|
50 |
* Option to change ordering of posts.
|
51 |
* Set which category the posts should come form.
|
52 |
* Add dropdownbox entry for 'all' categories.
|
|
|
53 |
* Set how many posts to show.
|
54 |
* Option to hide widget, if category have currently no posts.
|
55 |
* Add option to disable subcategories.
|
@@ -134,6 +135,10 @@ We know there are peopel how use PHP 5.2 [wordpress.org/about/stats](https://wor
|
|
134 |
== Changelog ==
|
135 |
[Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget?utm_source=wordpress_org&utm_campaign=changelog_cpw&utm_medium=web)
|
136 |
|
|
|
|
|
|
|
|
|
137 |
= 4.7.2 - February 25th 2017 =
|
138 |
* Add option to disable only the font styles
|
139 |
* Fixed if option 'Everything is a link' no closing anchor tag
|
3 |
Donate link: http://mkrdip.me/donate
|
4 |
Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 4.9
|
7 |
+
Stable tag: 4.7.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
50 |
* Option to change ordering of posts.
|
51 |
* Set which category the posts should come form.
|
52 |
* Add dropdownbox entry for 'all' categories.
|
53 |
+
* Option to filter by post status.
|
54 |
* Set how many posts to show.
|
55 |
* Option to hide widget, if category have currently no posts.
|
56 |
* Add option to disable subcategories.
|
135 |
== Changelog ==
|
136 |
[Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget?utm_source=wordpress_org&utm_campaign=changelog_cpw&utm_medium=web)
|
137 |
|
138 |
+
= 4.7.3 - October 10th 2017 =
|
139 |
+
* Add option to filter by post status
|
140 |
+
* Fixed footer section do not change when switching to and from "all posts"
|
141 |
+
|
142 |
= 4.7.2 - February 25th 2017 =
|
143 |
* Add option to disable only the font styles
|
144 |
* Fixed if option 'Everything is a link' no closing anchor tag
|