Version Description
- New: Button class option
- Fix: Duplicate post classes
- Fix: Post classes PHP notice in some themes
- Fix: PHP 7.2 PHP warning while editing lists
- Tweak: Pass $settings to wpsp_wrapper_atts filter
- Tweak: Remove font-size and line-height CSS (allow themes to handle it)
Download this release
Release Info
Developer | edge22 |
Plugin | WP Show Posts |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.3
- admin/ajax.php +4 -0
- admin/metabox.php +19 -1
- css/wp-show-posts-min.css +1 -1
- css/wp-show-posts.css +0 -11
- inc/defaults.php +2 -1
- inc/functions.php +3 -2
- readme.txt +18 -107
- wp-show-posts.php +16 -7
admin/ajax.php
CHANGED
@@ -34,6 +34,10 @@ if ( ! function_exists( 'wpsp_get_terms' ) ) {
|
|
34 |
wp_die( 'Permission declined' );
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
37 |
$terms = get_terms( sanitize_key( $_POST[ 'taxonomy' ] ), 'orderby=count&hide_empty=1' );
|
38 |
$count = count( $terms );
|
39 |
$types = array();
|
34 |
wp_die( 'Permission declined' );
|
35 |
}
|
36 |
|
37 |
+
if ( empty( $_POST['taxonomy'] ) ) {
|
38 |
+
die();
|
39 |
+
}
|
40 |
+
|
41 |
$terms = get_terms( sanitize_key( $_POST[ 'taxonomy' ] ), 'orderby=count&hide_empty=1' );
|
42 |
$count = count( $terms );
|
43 |
$types = array();
|
admin/metabox.php
CHANGED
@@ -467,7 +467,25 @@ if ( ! function_exists( 'wpsp_register' ) ) {
|
|
467 |
'wpsp_read_more_text', // Same as control name.
|
468 |
array(
|
469 |
'sanitize_callback' => 'wp_kses_post',
|
470 |
-
'default' => $defaults[ 'wpsp_read_more_text' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
)
|
472 |
);
|
473 |
|
467 |
'wpsp_read_more_text', // Same as control name.
|
468 |
array(
|
469 |
'sanitize_callback' => 'wp_kses_post',
|
470 |
+
'default' => $defaults[ 'wpsp_read_more_text' ]
|
471 |
+
)
|
472 |
+
);
|
473 |
+
|
474 |
+
$manager->register_control(
|
475 |
+
'wpsp_read_more_class', // Same as setting name.
|
476 |
+
array(
|
477 |
+
'type' => 'text',
|
478 |
+
'section' => 'wpsp_content',
|
479 |
+
'label' => esc_html__( 'Read more button class', 'wp-show-posts' ),
|
480 |
+
'priority' => 75
|
481 |
+
)
|
482 |
+
);
|
483 |
+
|
484 |
+
$manager->register_setting(
|
485 |
+
'wpsp_read_more_class', // Same as control name.
|
486 |
+
array(
|
487 |
+
'sanitize_callback' => 'esc_attr',
|
488 |
+
'default' => $defaults[ 'wpsp_read_more_class' ] ? $defaults[ 'wpsp_read_more_class' ] : ''
|
489 |
)
|
490 |
);
|
491 |
|
css/wp-show-posts-min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
body .wp-show-posts a{box-shadow:0 0 0 transparent}.wp-show-posts-entry-title a{text-decoration:none}a.wp-show-posts-read-more,a.wp-show-posts-read-more:visited{display:inline-block;padding:8px 15px;border:2px solid #222;color:#222;font-size
|
1 |
+
body .wp-show-posts a{box-shadow:0 0 0 transparent}.wp-show-posts-entry-title a{text-decoration:none}a.wp-show-posts-read-more,a.wp-show-posts-read-more:visited{display:inline-block;padding:8px 15px;border:2px solid #222;color:#222;font-size:.8em;text-decoration:none}.wpsp-read-more{margin:0 0 1em;display:inline-block}a.wp-show-posts-read-more:focus,a.wp-show-posts-read-more:hover{border:2px solid transparent;color:#fff;background:#222;text-decoration:none}.wp-show-posts-image{margin-bottom:1em}.wp-show-posts-image.wpsp-image-left{float:left;margin-right:1.5em}.wp-show-posts-image.wpsp-image-right{float:right;margin-left:1.5em}.wp-show-posts-image.wpsp-image-center{display:block;text-align:center}.wp-show-posts-image img{margin:0!important;vertical-align:bottom;height:auto}.wp-show-posts-entry-header{margin:0 0 1em;padding:0}.wp-show-posts .wp-show-posts-entry-title{margin:0}.wp-show-posts-updated{display:none}.wp-show-posts-entry-content,.wp-show-posts-entry-summary{margin-bottom:1em}.wp-show-posts-entry-meta{font-size:.8em}.wp-show-posts-separator{opacity:.5}.wp-show-posts-meta a,.wp-show-posts-meta a:visited{color:rgba(0,0,0,.5)}.stack-wp-show-posts-byline,.stack-wp-show-posts-posted-on{display:block}.wp-show-posts-entry-meta-below-post{margin-bottom:1em}.wp-show-posts-columns:not(.wp-show-posts-masonry){display:flex;flex-wrap:wrap}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block){display:flex;flex-direction:row}.wp-show-posts-columns .wp-show-posts-single:not(.wp-show-posts-masonry-block) .wp-show-posts-image img{flex:0 0 auto;object-fit:scale-down}.wpsp-clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child){margin-bottom:2em}.wpsp-load-more{margin-top:2em}.wp-show-posts-columns .wp-show-posts-inner{flex:1}.wp-show-posts-inner:after{clear:both;display:table;content:'';width:0;height:0;overflow:hidden;visibility:hidden}.wp-show-posts-single.post{margin-bottom:0}@media (min-width:768px){.wpsp-col-1,.wpsp-col-10,.wpsp-col-11,.wpsp-col-12,.wpsp-col-2,.wpsp-col-20,.wpsp-col-3,.wpsp-col-4,.wpsp-col-5,.wpsp-col-6,.wpsp-col-7,.wpsp-col-8,.wpsp-col-9{float:left}.wpsp-col-1{width:8.333333%}.wpsp-col-2{width:16.666667%}.wpsp-col-3{width:25%}.wpsp-col-4{width:33.333%}.wpsp-col-5{width:41.666667%}.wpsp-col-6{width:50%}.wpsp-col-7{width:58.333333%}.wpsp-col-8{width:66.666667%}.wpsp-col-9{width:75%}.wpsp-col-10{width:83.333333%}.wpsp-col-11{width:91.666667%}.wpsp-col-12{width:100%}.wpsp-col-20{width:20%}}@media (max-width:767px){.wp-show-posts-columns,.wp-show-posts-inner{margin-left:0!important;margin-right:0!important}.wp-show-posts-columns .wp-show-posts-single{display:block;width:100%}.wp-show-posts-image.wpsp-image-left,.wp-show-posts-image.wpsp-image-right{float:none;margin-right:0;margin-left:0}}.wp-show-posts-inner :last-child{margin-bottom:0}.screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important}.screen-reader-text:active,.screen-reader-text:focus,.screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wpsp-clearfix:after{content:".";display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}
|
css/wp-show-posts.css
CHANGED
@@ -60,7 +60,6 @@ a.wp-show-posts-read-more:focus {
|
|
60 |
}
|
61 |
|
62 |
.wp-show-posts .wp-show-posts-entry-title {
|
63 |
-
line-height: 1.5em;
|
64 |
margin: 0;
|
65 |
}
|
66 |
|
@@ -126,16 +125,6 @@ a.wp-show-posts-read-more:focus {
|
|
126 |
margin-top: 2em;
|
127 |
}
|
128 |
|
129 |
-
.wp-show-posts-columns .wp-show-posts-entry-title {
|
130 |
-
font-size: 25px;
|
131 |
-
}
|
132 |
-
|
133 |
-
.wp-show-posts-columns .wp-show-posts-single.col-md-4 .wp-show-posts-entry-title,
|
134 |
-
.wp-show-posts-columns .wp-show-posts-single.col-md-3 .wp-show-posts-entry-title,
|
135 |
-
.wp-show-posts-columns .wp-show-posts-single.col-md-20 .wp-show-posts-entry-title {
|
136 |
-
font-size: 20px;
|
137 |
-
}
|
138 |
-
|
139 |
.wp-show-posts-columns .wp-show-posts-inner {
|
140 |
flex: 1;
|
141 |
}
|
60 |
}
|
61 |
|
62 |
.wp-show-posts .wp-show-posts-entry-title {
|
|
|
63 |
margin: 0;
|
64 |
}
|
65 |
|
125 |
margin-top: 2em;
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
.wp-show-posts-columns .wp-show-posts-inner {
|
129 |
flex: 1;
|
130 |
}
|
inc/defaults.php
CHANGED
@@ -56,7 +56,8 @@ if ( ! function_exists( 'wpsp_get_defaults' ) ) {
|
|
56 |
'wpsp_wrapper_class' => '',
|
57 |
'wpsp_wrapper_id' => false,
|
58 |
'wpsp_wrapper_style' => '',
|
59 |
-
'wpsp_no_results' => __( 'Sorry, no posts were found.','wp-show-posts' )
|
|
|
60 |
);
|
61 |
|
62 |
return apply_filters( 'wpsp_defaults', $defaults );
|
56 |
'wpsp_wrapper_class' => '',
|
57 |
'wpsp_wrapper_id' => false,
|
58 |
'wpsp_wrapper_style' => '',
|
59 |
+
'wpsp_no_results' => __( 'Sorry, no posts were found.','wp-show-posts' ),
|
60 |
+
'wpsp_read_more_class' => 'wp-show-posts-read-more',
|
61 |
);
|
62 |
|
63 |
return apply_filters( 'wpsp_defaults', $defaults );
|
inc/functions.php
CHANGED
@@ -233,10 +233,11 @@ if ( ! function_exists( 'wpsp_read_more' ) ) {
|
|
233 |
|
234 |
function wpsp_read_more( $settings ) {
|
235 |
if ( $settings[ 'read_more_text' ] ) {
|
236 |
-
echo apply_filters( 'wpsp_read_more_output', sprintf('<div class="wpsp-read-more"><a title="%1$s" class="
|
237 |
the_title_attribute( 'echo=0' ),
|
238 |
esc_url( get_permalink() ),
|
239 |
-
$settings[ 'read_more_text' ]
|
|
|
240 |
));
|
241 |
}
|
242 |
}
|
233 |
|
234 |
function wpsp_read_more( $settings ) {
|
235 |
if ( $settings[ 'read_more_text' ] ) {
|
236 |
+
echo apply_filters( 'wpsp_read_more_output', sprintf('<div class="wpsp-read-more"><a title="%1$s" class="%4$s" href="%2$s">%3$s</a></div>',
|
237 |
the_title_attribute( 'echo=0' ),
|
238 |
esc_url( get_permalink() ),
|
239 |
+
$settings[ 'read_more_text' ],
|
240 |
+
esc_attr( $settings['read_more_class'] )
|
241 |
));
|
242 |
}
|
243 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpshowposts.com
|
|
4 |
Tags: show posts, display posts shortcode, portfolio, gallery, post columns
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -49,6 +49,7 @@ Here are the features in the free version:
|
|
49 |
* Excerpt length
|
50 |
* Include title
|
51 |
* Read more text
|
|
|
52 |
|
53 |
= Meta =
|
54 |
|
@@ -162,6 +163,14 @@ In most cases, #1 will work fine and is way easier.
|
|
162 |
|
163 |
== Changelog ==
|
164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
= 1.1.2 =
|
166 |
* Fix: Performance issue dealing with lots of terms in list admin
|
167 |
* Fix: Post class clashes with GP Premium
|
@@ -199,61 +208,16 @@ In most cases, #1 will work fine and is way easier.
|
|
199 |
* Add margin to the top of pagination
|
200 |
* Use manual excerpt if it's set
|
201 |
|
202 |
-
= 0.9 =
|
203 |
-
* Fix bug where terms weren't saving
|
204 |
-
* Strip oembed URLs from excerpt
|
205 |
-
|
206 |
-
= 0.8 =
|
207 |
-
* Strip shortcodes from excerpts
|
208 |
-
* Add ellipses after excerpts
|
209 |
-
* Fix some broken text domains for translations
|
210 |
-
|
211 |
-
= 0.7 =
|
212 |
-
* Prevent direct access to files
|
213 |
-
* Add prefix to all column classes to avoid conflicts
|
214 |
-
* Use wp_trim_words() function for excerpts
|
215 |
-
* Fix conflict with Maintenance plugin
|
216 |
-
* Make columns full width on mobile
|
217 |
-
* Allow more tag usage when excerpt is set
|
218 |
-
* Add blank option in widget to fix bug in Customizer/Elementor
|
219 |
-
|
220 |
-
= 0.6 =
|
221 |
-
* Add height: auto to images to prevent image stretching in Beaver Builder
|
222 |
-
* Prevent horizontal scrolling when posts are in columns
|
223 |
-
* Change "More query args" section name to "More settings"
|
224 |
-
* Allow multiple IDs in "Post ID" option
|
225 |
-
* Add "Exclude IDs" option
|
226 |
-
* Add "No results message" option
|
227 |
-
* Add "WP Show Posts" widget to add posts in widget areas
|
228 |
-
|
229 |
-
= 0.5 =
|
230 |
-
* Fix conflict with Yoast SEO causing taxonomy and terms fields to be blank
|
231 |
-
* Add support for translations
|
232 |
-
|
233 |
-
= 0.4 =
|
234 |
-
* Fix column width issue when content is disabled
|
235 |
-
* Fix pagination issue when post list is on the front page
|
236 |
-
* Disable pagination in single posts
|
237 |
-
* Fix saving of taxonomy and terms fields
|
238 |
-
* Force no underline on read more buttons
|
239 |
-
|
240 |
-
= 0.3 =
|
241 |
-
* Remove attachment post type from list for now
|
242 |
-
* Don't show pagination if there's no posts
|
243 |
-
* Move wpsp_before_title hook into the <header> element
|
244 |
-
* New hook: wpsp_before_wrapper
|
245 |
-
* New hook: wpsp_before_header
|
246 |
-
|
247 |
-
= 0.2 =
|
248 |
-
* Fix issue with posts showing up in wrong area on page
|
249 |
-
* Remove read more link if the <!-- more --> tag is used
|
250 |
-
* Wrap read more button in div: .wpsp-read-more
|
251 |
-
|
252 |
-
= 0.1 =
|
253 |
-
* Initial release
|
254 |
-
|
255 |
== Upgrade Notice ==
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
= 1.1.2 =
|
258 |
* Fix: Performance issue dealing with lots of terms in list admin
|
259 |
* Fix: Post class clashes with GP Premium
|
@@ -290,56 +254,3 @@ In most cases, #1 will work fine and is way easier.
|
|
290 |
* Clean up defaults to only include free options
|
291 |
* Add margin to the top of pagination
|
292 |
* Use manual excerpt if it's set
|
293 |
-
|
294 |
-
= 0.9 =
|
295 |
-
* Fix bug where terms weren't saving
|
296 |
-
* Strip oembed URLs from excerpt
|
297 |
-
|
298 |
-
= 0.8 =
|
299 |
-
* Strip shortcodes from excerpts
|
300 |
-
* Add ellipses after excerpts
|
301 |
-
* Fix some broken text domains for translations
|
302 |
-
|
303 |
-
= 0.7 =
|
304 |
-
* Prevent direct access to files
|
305 |
-
* Add prefix to all column classes to avoid conflicts
|
306 |
-
* Use wp_trim_words() function for excerpts
|
307 |
-
* Fix conflict with Maintenance plugin
|
308 |
-
* Make columns full width on mobile
|
309 |
-
* Allow more tag usage when excerpt is set
|
310 |
-
* Add blank option in widget to fix bug in Customizer/Elementor
|
311 |
-
|
312 |
-
= 0.6 =
|
313 |
-
* Add height: auto to images to prevent image stretching in Beaver Builder
|
314 |
-
* Prevent horizontal scrolling when posts are in columns
|
315 |
-
* Change "More query args" section name to "More settings"
|
316 |
-
* Allow multiple IDs in "Post ID" option
|
317 |
-
* Add "Exclude IDs" option
|
318 |
-
* Add "No results message" option
|
319 |
-
* Add "WP Show Posts" widget to add posts in widget areas
|
320 |
-
|
321 |
-
= 0.5 =
|
322 |
-
* Fix conflict with Yoast SEO causing taxonomy and terms fields to be blank
|
323 |
-
* Add support for translations
|
324 |
-
|
325 |
-
= 0.4 =
|
326 |
-
* Fix column width issue when content is disabled
|
327 |
-
* Fix pagination issue when post list is on the front page
|
328 |
-
* Disable pagination in single posts
|
329 |
-
* Fix saving of taxonomy and terms fields
|
330 |
-
* Force no underline on read more buttons
|
331 |
-
|
332 |
-
= 0.3 =
|
333 |
-
* Remove attachment post type from list for now
|
334 |
-
* Don't show pagination if there's no posts
|
335 |
-
* Move wpsp_before_title hook into the <header> element
|
336 |
-
* New hook: wpsp_before_wrapper
|
337 |
-
* New hook: wpsp_before_header
|
338 |
-
|
339 |
-
= 0.2 =
|
340 |
-
* Fix issue with posts showing up in wrong area on page
|
341 |
-
* Remove read more link if the <!-- more --> tag is used
|
342 |
-
* Wrap read more button in div: .wpsp-read-more
|
343 |
-
|
344 |
-
= 0.1 =
|
345 |
-
* Initial release
|
4 |
Tags: show posts, display posts shortcode, portfolio, gallery, post columns
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.1.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
49 |
* Excerpt length
|
50 |
* Include title
|
51 |
* Read more text
|
52 |
+
* Read more button class
|
53 |
|
54 |
= Meta =
|
55 |
|
163 |
|
164 |
== Changelog ==
|
165 |
|
166 |
+
= 1.1.3 =
|
167 |
+
* New: Button class option
|
168 |
+
* Fix: Duplicate post classes
|
169 |
+
* Fix: Post classes PHP notice in some themes
|
170 |
+
* Fix: PHP 7.2 PHP warning while editing lists
|
171 |
+
* Tweak: Pass $settings to wpsp_wrapper_atts filter
|
172 |
+
* Tweak: Remove font-size and line-height CSS (allow themes to handle it)
|
173 |
+
|
174 |
= 1.1.2 =
|
175 |
* Fix: Performance issue dealing with lots of terms in list admin
|
176 |
* Fix: Post class clashes with GP Premium
|
208 |
* Add margin to the top of pagination
|
209 |
* Use manual excerpt if it's set
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
== Upgrade Notice ==
|
212 |
|
213 |
+
= 1.1.3 =
|
214 |
+
* New: Button class option
|
215 |
+
* Fix: Duplicate post classes
|
216 |
+
* Fix: Post classes PHP notice in some themes
|
217 |
+
* Fix: PHP 7.2 PHP warning while editing lists
|
218 |
+
* Tweak: Pass $settings to wpsp_wrapper_atts filter
|
219 |
+
* Tweak: Remove font-size and line-height CSS (allow themes to handle it)
|
220 |
+
|
221 |
= 1.1.2 =
|
222 |
* Fix: Performance issue dealing with lots of terms in list admin
|
223 |
* Fix: Post class clashes with GP Premium
|
254 |
* Clean up defaults to only include free options
|
255 |
* Add margin to the top of pagination
|
256 |
* Use manual excerpt if it's set
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wp-show-posts.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Show Posts
|
4 |
Plugin URI: https://wpshowposts.com
|
5 |
Description: WP Show Posts allows you to list posts (from any post type) anywhere on your site. This includes WooCommerce products or any other post type you might have! Check out the pro version for even more features at https://wpshowposts.com.
|
6 |
-
Version: 1.1.
|
7 |
Author: Tom Usborne
|
8 |
Author URI: https://tomusborne.com
|
9 |
License: GNU General Public License v2 or later
|
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
}
|
18 |
|
19 |
// Define the current version
|
20 |
-
define( 'WPSP_VERSION', '1.1.
|
21 |
|
22 |
// Add resizer script
|
23 |
if ( ! class_exists( 'WPSP_Resize' ) ) {
|
@@ -142,6 +142,7 @@ function wpsp_display( $id, $custom_settings = false ) {
|
|
142 |
'no_results' => wp_kses_post( wpsp_get_setting( $id, 'wpsp_no_results' ) ),
|
143 |
'post_meta_bottom_style' => sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_meta_bottom_style' ) ),
|
144 |
'post_meta_top_style' => sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_meta_top_style' ) ),
|
|
|
145 |
) );
|
146 |
|
147 |
// Replace args with any custom args.
|
@@ -365,7 +366,7 @@ function wpsp_display( $id, $custom_settings = false ) {
|
|
365 |
// Get the wrapper ID
|
366 |
$wrapper_id = ' id="wpsp-' . $id . '"';
|
367 |
|
368 |
-
$wrapper_atts = apply_filters( 'wpsp_wrapper_atts', '' );
|
369 |
|
370 |
do_action( 'wpsp_before_wrapper', $settings );
|
371 |
|
@@ -403,15 +404,23 @@ function wpsp_display( $id, $custom_settings = false ) {
|
|
403 |
$column_class .= ' wpsp-' . $settings[ 'columns' ];
|
404 |
}
|
405 |
|
|
|
|
|
406 |
// Merge our classes with the post classes.
|
407 |
-
|
408 |
-
|
409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
|
411 |
// Start inner container
|
412 |
printf( '<%1$s class="%2$s" itemtype="http://schema.org/%3$s" itemscope>',
|
413 |
$settings[ 'inner_wrapper' ],
|
414 |
-
|
415 |
$settings[ 'itemtype' ]
|
416 |
);
|
417 |
|
3 |
Plugin Name: WP Show Posts
|
4 |
Plugin URI: https://wpshowposts.com
|
5 |
Description: WP Show Posts allows you to list posts (from any post type) anywhere on your site. This includes WooCommerce products or any other post type you might have! Check out the pro version for even more features at https://wpshowposts.com.
|
6 |
+
Version: 1.1.3
|
7 |
Author: Tom Usborne
|
8 |
Author URI: https://tomusborne.com
|
9 |
License: GNU General Public License v2 or later
|
17 |
}
|
18 |
|
19 |
// Define the current version
|
20 |
+
define( 'WPSP_VERSION', '1.1.3' );
|
21 |
|
22 |
// Add resizer script
|
23 |
if ( ! class_exists( 'WPSP_Resize' ) ) {
|
142 |
'no_results' => wp_kses_post( wpsp_get_setting( $id, 'wpsp_no_results' ) ),
|
143 |
'post_meta_bottom_style' => sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_meta_bottom_style' ) ),
|
144 |
'post_meta_top_style' => sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_meta_top_style' ) ),
|
145 |
+
'read_more_class' => esc_attr( wpsp_get_setting( $id, 'wpsp_read_more_class' ) ),
|
146 |
) );
|
147 |
|
148 |
// Replace args with any custom args.
|
366 |
// Get the wrapper ID
|
367 |
$wrapper_id = ' id="wpsp-' . $id . '"';
|
368 |
|
369 |
+
$wrapper_atts = apply_filters( 'wpsp_wrapper_atts', '', $settings );
|
370 |
|
371 |
do_action( 'wpsp_before_wrapper', $settings );
|
372 |
|
404 |
$column_class .= ' wpsp-' . $settings[ 'columns' ];
|
405 |
}
|
406 |
|
407 |
+
$post_classes = implode( ' ', $settings[ 'inner_wrapper_class' ] );
|
408 |
+
|
409 |
// Merge our classes with the post classes.
|
410 |
+
if ( has_filter( 'post_class', 'generate_blog_post_classes' ) ) {
|
411 |
+
remove_filter( 'post_class', 'generate_blog_post_classes' ); // Remove GPP classes.
|
412 |
+
}
|
413 |
+
|
414 |
+
$post_classes .= ' ' . implode( ' ', get_post_class() );
|
415 |
+
|
416 |
+
if ( function_exists( 'generate_blog_post_classes' ) ) {
|
417 |
+
add_filter( 'post_class', 'generate_blog_post_classes' ); // Re-add them.
|
418 |
+
}
|
419 |
|
420 |
// Start inner container
|
421 |
printf( '<%1$s class="%2$s" itemtype="http://schema.org/%3$s" itemscope>',
|
422 |
$settings[ 'inner_wrapper' ],
|
423 |
+
$post_classes . $column_class . $featured,
|
424 |
$settings[ 'itemtype' ]
|
425 |
);
|
426 |
|