WP Show Posts - Version 1.1.2

Version Description

  • Fix: Performance issue dealing with lots of terms in list admin
  • Fix: Post class clashes with GP Premium
  • Tweak: Allow name in shortcode instead of ID
  • Tweak: Use theme defined font size for title elements (removes the default 30px)
Download this release

Release Info

Developer edge22
Plugin Icon 128x128 WP Show Posts
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

admin/js/admin-scripts.js CHANGED
@@ -67,13 +67,14 @@ jQuery( document ).ready( function( $ ) {
67
 
68
  // Show any selected terms
69
  var terms = wpsp_get_terms( $( '#wpsp-taxonomy' ).val() );
 
70
 
71
  $.each(terms, function(key, value) {
72
  if ( null !== value ) {
73
- if ( $.isArray( wpsp_get_option( 'wpsp_tax_term' ) ) ) {
74
- var checked = ( $.inArray( value, wpsp_get_option( 'wpsp_tax_term' ) ) > -1 ) ? 'checked="checked"' : '';
75
  } else {
76
- var checked = ( value === wpsp_get_option( 'wpsp_tax_term' ) ) ? 'checked="checked"' : '';
77
  }
78
 
79
  $('#butterbean-control-wpsp_tax_term .butterbean-checkbox-list').append( $( '<li><label><input ' + checked + ' type="checkbox" value="' + value + '" name="butterbean_wp_show_posts_setting_wpsp_tax_term[]" />' + value + '</label></li>' ) );
67
 
68
  // Show any selected terms
69
  var terms = wpsp_get_terms( $( '#wpsp-taxonomy' ).val() );
70
+ var term_values = wpsp_get_option( 'wpsp_tax_term' );
71
 
72
  $.each(terms, function(key, value) {
73
  if ( null !== value ) {
74
+ if ( $.isArray( term_values ) ) {
75
+ var checked = ( $.inArray( value, term_values ) > -1 ) ? 'checked="checked"' : '';
76
  } else {
77
+ var checked = ( value === term_values ) ? 'checked="checked"' : '';
78
  }
79
 
80
  $('#butterbean-control-wpsp_tax_term .butterbean-checkbox-list').append( $( '<li><label><input ' + checked + ' type="checkbox" value="' + value + '" name="butterbean_wp_show_posts_setting_wpsp_tax_term[]" />' + value + '</label></li>' ) );
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:0.8em;text-decoration:none}.wpsp-read-more{margin:0 0 1em;display:inline-block}a.wp-show-posts-read-more:hover,a.wp-show-posts-read-more:focus{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{font-size:30px;line-height:1.5em;margin:0}.wp-show-posts-updated{display:none}.wp-show-posts-entry-summary,.wp-show-posts-entry-content{margin-bottom:1em}.wp-show-posts-entry-meta{font-size:0.8em}.wp-show-posts-separator{opacity:0.5}.wp-show-posts-meta a,.wp-show-posts-meta a:visited{color:rgba( 0,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-entry-title{font-size:25px}.wp-show-posts-columns .wp-show-posts-single.col-md-4 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-3 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-20 .wp-show-posts-entry-title{font-size:20px}.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-2,.wpsp-col-3,.wpsp-col-4,.wpsp-col-5,.wpsp-col-6,.wpsp-col-7,.wpsp-col-8,.wpsp-col-9,.wpsp-col-10,.wpsp-col-11,.wpsp-col-12,.wpsp-col-20{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:hover,.screen-reader-text:active,.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto !important;color:#21759b;display:block;font-size:14px;font-weight:bold;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}
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:0.8em;text-decoration:none}.wpsp-read-more{margin:0 0 1em;display:inline-block}a.wp-show-posts-read-more:hover,a.wp-show-posts-read-more:focus{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{line-height:1.5em;margin:0}.wp-show-posts-updated{display:none}.wp-show-posts-entry-summary,.wp-show-posts-entry-content{margin-bottom:1em}.wp-show-posts-entry-meta{font-size:0.8em}.wp-show-posts-separator{opacity:0.5}.wp-show-posts-meta a,.wp-show-posts-meta a:visited{color:rgba( 0,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-entry-title{font-size:25px}.wp-show-posts-columns .wp-show-posts-single.col-md-4 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-3 .wp-show-posts-entry-title,.wp-show-posts-columns .wp-show-posts-single.col-md-20 .wp-show-posts-entry-title{font-size:20px}.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-2,.wpsp-col-3,.wpsp-col-4,.wpsp-col-5,.wpsp-col-6,.wpsp-col-7,.wpsp-col-8,.wpsp-col-9,.wpsp-col-10,.wpsp-col-11,.wpsp-col-12,.wpsp-col-20{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:hover,.screen-reader-text:active,.screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0, 0, 0, 0.6);clip:auto !important;color:#21759b;display:block;font-size:14px;font-weight:bold;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
- font-size: 30px;
64
  line-height: 1.5em;
65
  margin: 0;
66
  }
60
  }
61
 
62
  .wp-show-posts .wp-show-posts-entry-title {
 
63
  line-height: 1.5em;
64
  margin: 0;
65
  }
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.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -162,6 +162,12 @@ In most cases, #1 will work fine and is way easier.
162
 
163
  == Changelog ==
164
 
 
 
 
 
 
 
165
  = 1.1.1 =
166
  * Fix: Fix image hover effects in WPSP Pro
167
 
@@ -248,6 +254,12 @@ In most cases, #1 will work fine and is way easier.
248
 
249
  == Upgrade Notice ==
250
 
 
 
 
 
 
 
251
  = 1.1.1 =
252
  * Fix: Fix image hover effects in WPSP Pro
253
 
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.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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
168
+ * Tweak: Allow name in shortcode instead of ID
169
+ * Tweak: Use theme defined font size for title elements (removes the default 30px)
170
+
171
  = 1.1.1 =
172
  * Fix: Fix image hover effects in WPSP Pro
173
 
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
260
+ * Tweak: Allow name in shortcode instead of ID
261
+ * Tweak: Use theme defined font size for title elements (removes the default 30px)
262
+
263
  = 1.1.1 =
264
  * Fix: Fix image hover effects in WPSP Pro
265
 
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.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.1' );
21
 
22
  // Add resizer script
23
  if ( ! class_exists( 'WPSP_Resize' ) ) {
@@ -404,7 +404,9 @@ function wpsp_display( $id, $custom_settings = false ) {
404
  }
405
 
406
  // Merge our classes with the post classes.
 
407
  $settings['inner_wrapper_class'] = array_merge( $settings['inner_wrapper_class'], get_post_class() );
 
408
 
409
  // Start inner container
410
  printf( '<%1$s class="%2$s" itemtype="http://schema.org/%3$s" itemscope>',
@@ -541,14 +543,21 @@ function wpsp_shortcode_function( $atts ) {
541
  $atts = shortcode_atts(
542
  array(
543
  'id' => '',
 
544
  'settings' => ''
545
  ), $atts, 'wp_show_posts'
546
  );
547
 
548
  ob_start();
549
 
550
- if ( $atts[ 'id' ] ) {
551
- wpsp_display( $atts[ 'id' ], $atts[ 'settings' ] );
 
 
 
 
 
 
552
  }
553
 
554
  return ob_get_clean();
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.2
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.2' );
21
 
22
  // Add resizer script
23
  if ( ! class_exists( 'WPSP_Resize' ) ) {
404
  }
405
 
406
  // Merge our classes with the post classes.
407
+ remove_filter( 'post_class', 'generate_blog_post_classes' ); // Remove GPP classes.
408
  $settings['inner_wrapper_class'] = array_merge( $settings['inner_wrapper_class'], get_post_class() );
409
+ add_filter( 'post_class', 'generate_blog_post_classes' ); // Re-add them.
410
 
411
  // Start inner container
412
  printf( '<%1$s class="%2$s" itemtype="http://schema.org/%3$s" itemscope>',
543
  $atts = shortcode_atts(
544
  array(
545
  'id' => '',
546
+ 'name' => '',
547
  'settings' => ''
548
  ), $atts, 'wp_show_posts'
549
  );
550
 
551
  ob_start();
552
 
553
+ // Get the ID from the list name if it's provided.
554
+ if ( ! empty( $atts['name'] ) ) {
555
+ $list = get_page_by_title( $atts['name'], 'OBJECT', 'wp_show_posts' );
556
+ $atts['id'] = $list->ID;
557
+ }
558
+
559
+ if ( $atts['id'] ) {
560
+ wpsp_display( $atts['id'], $atts['settings'] );
561
  }
562
 
563
  return ob_get_clean();