Changeset 1476018 for wp-show-posts
- Timestamp:
- 08/16/2016 09:36:46 PM (9 years ago)
- Location:
- wp-show-posts/trunk
- Files:
-
- 6 edited
-
admin/metabox.php (modified) (4 diffs)
-
css/wp-show-posts-min.css (modified) (1 diff)
-
css/wp-show-posts.css (modified) (2 diffs)
-
inc/defaults.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
wp-show-posts.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-show-posts/trunk/admin/metabox.php
r1460515 r1476018 577 577 'wpsp_query_args', 578 578 array( 579 'label' => esc_html__( 'More query args', 'wp-show-posts' ),579 'label' => esc_html__( 'More settings', 'wp-show-posts' ), 580 580 'icon' => 'dashicons-admin-generic', 581 581 'priority' => 999 … … 621 621 'wpsp_post_id', // Same as setting name. 622 622 array( 623 'type' => ' number',624 'section' => 'wpsp_query_args', 625 'label' => esc_html__( 'Post ID ', 'wp-show-posts' )623 'type' => 'text', 624 'section' => 'wpsp_query_args', 625 'label' => esc_html__( 'Post IDs', 'wp-show-posts' ) 626 626 ) 627 627 ); … … 630 630 'wpsp_post_id', // Same as control name. 631 631 array( 632 'sanitize_callback' => ' wpsp_sanitize_intval',632 'sanitize_callback' => 'sanitize_text_field', 633 633 'default' => $defaults[ 'wpsp_post_id' ] ? $defaults[ 'wpsp_post_id' ] : '' 634 ) 635 ); 636 637 $manager->register_control( 638 'wpsp_exclude_post_id', // Same as setting name. 639 array( 640 'type' => 'text', 641 'section' => 'wpsp_query_args', 642 'label' => esc_html__( 'Exclude Post IDs', 'wp-show-posts' ) 643 ) 644 ); 645 646 $manager->register_setting( 647 'wpsp_exclude_post_id', // Same as control name. 648 array( 649 'sanitize_callback' => 'sanitize_text_field', 650 'default' => $defaults[ 'wpsp_exclude_post_id' ] ? $defaults[ 'wpsp_exclude_post_id' ] : '' 634 651 ) 635 652 ); … … 810 827 ) 811 828 ); 829 830 $manager->register_control( 831 'wpsp_no_results', // Same as setting name. 832 array( 833 'type' => 'text', 834 'section' => 'wpsp_query_args', 835 'label' => esc_html__( 'No results message', 'wp-show-posts' ) 836 ) 837 ); 838 839 $manager->register_setting( 840 'wpsp_no_results', // Same as control name. 841 array( 842 'sanitize_callback' => 'wp_kses_post', 843 'default' => $defaults[ 'wpsp_no_results' ] ? $defaults[ 'wpsp_no_results' ] : '' 844 ) 845 ); 812 846 } 813 847 endif; -
wp-show-posts/trunk/css/wp-show-posts-min.css
r1462786 r1476018 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;border-radius:3px;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 }.wp-show-posts-entry-header{margin:0 0 1em;padding:0}.wp-show-posts .wp-show-posts-entry-title{font-size:30px;line-height:35px;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;color:rgba( 0,0,0,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}.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}@media (min-width: 768px){.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-20{float:left}.col-1{width:8.333333%}.col-2{width:16.666667%}.col-3{width:25%}.col-4{width:33.333%}.col-5{width:41.666667%}.col-6{width:50%}.col-7{width:58.333333%}.col-8{width:66.666667%}.col-9{width:75%}.col-10{width:83.333333%}.col-11{width:91.666667%}.col-12{width:100%}.col-20{width:20%}}.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;border-radius:3px;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:35px;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;color:rgba( 0,0,0,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}.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}@media (min-width: 768px){.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col-20{float:left}.col-1{width:8.333333%}.col-2{width:16.666667%}.col-3{width:25%}.col-4{width:33.333%}.col-5{width:41.666667%}.col-6{width:50%}.col-7{width:58.333333%}.col-8{width:66.666667%}.col-9{width:75%}.col-10{width:83.333333%}.col-11{width:91.666667%}.col-12{width:100%}.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-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} -
wp-show-posts/trunk/css/wp-show-posts.css
r1462786 r1476018 53 53 margin: 0 !important; 54 54 vertical-align: bottom; 55 height: auto; 55 56 } 56 57 … … 180 181 .col-20 { 181 182 width: 20%; 183 } 184 } 185 186 @media (max-width: 767px) { 187 .wp-show-posts-columns, 188 .wp-show-posts-inner { 189 margin-left: 0 !important; 190 margin-right: 0 !important; 182 191 } 183 192 } -
wp-show-posts/trunk/inc/defaults.php
r1462786 r1476018 17 17 'wpsp_excerpt_length' => 30, 18 18 'wpsp_post_id' => '', 19 'wpsp_exclude_post_id' => '', 19 20 'wpsp_ignore_sticky_posts' => false, 20 21 'wpsp_image' => true, … … 55 56 'wpsp_wrapper_id' => false, 56 57 'wpsp_wrapper_style' => '', 58 'wpsp_no_results' => __( 'Sorry, no posts were found.','wp-show-posts' ), 57 59 'wpsp_ajax_pagination' => false, 58 60 'wpsp_masonry' => false, -
wp-show-posts/trunk/readme.txt
r1467146 r1476018 5 5 Requires at least: 4.0 6 6 Tested up to: 4.6 7 Stable tag: 0. 57 Stable tag: 0.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 148 148 == Changelog == 149 149 150 = 0.6 = 151 * Add height: auto to images to prevent image stretching in Beaver Builder 152 * Prevent horizontal scrolling when posts are in columns 153 * Change "More query args" section name to "More settings" 154 * Allow multiple IDs in "Post ID" option 155 * Add "Exclude IDs" option 156 * Add "No results message" option 157 * Add "WP Show Posts" widget to add posts in widget areas 158 150 159 = 0.5 = 151 160 * Fix conflict with Yoast SEO causing taxonomy and terms fields to be blank … … 176 185 == Upgrade Notice == 177 186 187 = 0.6 = 188 * Add height: auto to images to prevent image stretching in Beaver Builder 189 * Prevent horizontal scrolling when posts are in columns 190 * Change "More query args" section name to "More settings" 191 * Allow multiple IDs in "Post ID" option 192 * Add "Exclude IDs" option 193 * Add "No results message" option 194 * Add "WP Show Posts" widget to add posts in widget areas 195 178 196 = 0.5 = 179 197 * Fix conflict with Yoast SEO causing taxonomy and terms fields to be blank -
wp-show-posts/trunk/wp-show-posts.php
r1467146 r1476018 4 4 Plugin URI: https://wpshowposts.com 5 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: 0. 56 Version: 0.6 7 7 Author: Tom Usborne 8 8 Author URI: https://tomusborne.com … … 35 35 // Add admin functions 36 36 require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'admin/admin.php'; 37 38 // Add widget 39 require_once trailingslashit( plugin_dir_path( __FILE__ ) ) . 'admin/widget.php'; 37 40 38 41 if ( ! function_exists( 'wpsp_load_textdomain' ) ) : … … 104 107 $exclude_current = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_exclude_current' ) ); 105 108 $excerpt_length = absint( wpsp_get_setting( $id, 'wpsp_excerpt_length' ) ); 106 $post_id = absint( wpsp_get_setting( $id, 'wpsp_post_id' ) ); 109 $post_id = sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_id' ) ); 110 $exclude_post_id = sanitize_text_field( wpsp_get_setting( $id, 'wpsp_exclude_post_id' ) ); 107 111 $ignore_sticky_posts = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_ignore_sticky_posts' ) ); 108 112 $image_gallery = sanitize_text_field( wpsp_get_setting( $id, 'wpsp_image_gallery' ) ); … … 135 139 $wrapper_class = array_map( 'sanitize_html_class', ( explode( ' ', wpsp_get_setting( $id, 'wpsp_wrapper_class' ) ) ) ); 136 140 $wrapper_style = explode( ' ', esc_attr( wpsp_get_setting( $id, 'wpsp_wrapper_style' ) ) ); 141 $no_results = wp_kses_post( wpsp_get_setting( $id, 'wpsp_no_results' ) ); 137 142 $ajax_pagination = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_ajax_pagination' ) ); 138 143 $masonry = wp_validate_boolean( wpsp_get_setting( $id, 'wpsp_masonry' ) ); … … 228 233 } 229 234 235 // If Exclude Post IDs 236 if( $exclude_post_id ) { 237 $posts_not_in = array_map( 'intval', explode( ',', $exclude_post_id ) ); 238 $args['post__not_in'] = $posts_not_in; 239 } 240 230 241 // If Exclude Current 231 242 if( is_singular() && $exclude_current ) … … 248 259 wp_enqueue_script( 'wpsp-matchHeight', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'js/jquery.matchHeight.js', array( 'jquery' ), WPSP_VERSION, true ); 249 260 $wrapper_class[] = 'wp-show-posts-columns'; 250 $wrapper_style[] = 'margin- right:-' . $columns_gutter . ';';251 $inner_wrapper_style[] = 'margin: 0 ' . $columns_gutter . ' ' . $columns_gutter . ' 0;' . $border . $padding;261 $wrapper_style[] = 'margin-left:-' . $columns_gutter . ';'; 262 $inner_wrapper_style[] = 'margin: 0 0 ' . $columns_gutter . ' ' . $columns_gutter . ';' . $border . $padding; 252 263 endif; 253 264 … … 312 323 if( !empty( $wrapper_id ) ) 313 324 $wrapper_id = ' id="' . $wrapper_id . '"'; 325 326 $wrapper_atts = apply_filters( 'wpsp_wrapper_atts', '' ); 314 327 315 328 do_action( 'wpsp_before_wrapper' ); … … 325 338 326 339 // Start the wrapper 327 echo '<' . $wrapper . $wrapper_id . $wrapper_class . $wrapper_style . '>';340 echo '<' . $wrapper . $wrapper_id . $wrapper_class . $wrapper_style . $wrapper_atts . '>'; 328 341 329 342 if ( $masonry ) … … 408 421 } else { 409 422 // no posts found 410 echo apply_filters( 'wpsp_shortcode_no_results', wpautop( __( 'Sorry, no posts were found.','wp-show-posts' ) ) ); 423 echo ( $columns !== 'col-12' ) ? '<div class="wpsp-no-results" style="margin-left: ' . $columns_gutter . ';">' : ''; 424 echo wpautop( $no_results ); 425 echo ( $columns !== 'col-12' ) ? '</div>' : ''; 411 426 } 412 427 if ( $columns !== 'col-12' ) echo '<div class="wpsp-clear"></div>';
Note: See TracChangeset
for help on using the changeset viewer.