Plugin Directory

Changeset 1893043 for wp-show-posts


Ignore:
Timestamp:
06/14/2018 05:59:30 PM (7 years ago)
Author:
edge22
Message:

version 1.1.3

Location:
wp-show-posts/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wp-show-posts/trunk/admin/ajax.php

    r1801395 r1893043  
    3333        if ( ! isset( $_POST[ 'wpsp_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'wpsp_nonce' ], 'wpsp_nonce' ) ) {
    3434            wp_die( 'Permission declined' );
     35        }
     36
     37        if ( empty( $_POST['taxonomy'] ) ) {
     38            die();
    3539        }
    3640
  • wp-show-posts/trunk/admin/metabox.php

    r1801395 r1893043  
    468468            array(
    469469                'sanitize_callback' => 'wp_kses_post',
    470                 'default' => $defaults[ 'wpsp_read_more_text' ] ? $defaults[ 'wpsp_read_more_text' ] : ''
     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' ] : ''
    471489            )
    472490        );
  • wp-show-posts/trunk/css/wp-show-posts-min.css

    r1815911 r1893043  
    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}
     1body .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}
  • wp-show-posts/trunk/css/wp-show-posts.css

    r1815911 r1893043  
    6161
    6262.wp-show-posts .wp-show-posts-entry-title {
    63     line-height: 1.5em;
    6463    margin: 0;
    6564}
     
    125124.wpsp-load-more {
    126125    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;
    137126}
    138127
  • wp-show-posts/trunk/inc/defaults.php

    r1801395 r1893043  
    5757            'wpsp_wrapper_id'               => false,
    5858            'wpsp_wrapper_style'            => '',
    59             'wpsp_no_results'               => __( 'Sorry, no posts were found.','wp-show-posts' )
     59            'wpsp_no_results'               => __( 'Sorry, no posts were found.','wp-show-posts' ),
     60            'wpsp_read_more_class'          => 'wp-show-posts-read-more',
    6061        );
    6162
  • wp-show-posts/trunk/inc/functions.php

    r1801961 r1893043  
    234234    function wpsp_read_more( $settings ) {
    235235        if ( $settings[ 'read_more_text' ] ) {
    236             echo apply_filters( 'wpsp_read_more_output', sprintf('<div class="wpsp-read-more"><a title="%1$s" class="wp-show-posts-read-more" href="%2$s">%3$s</a></div>',
     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>',
    237237                the_title_attribute( 'echo=0' ),
    238238                esc_url( get_permalink() ),
    239                 $settings[ 'read_more_text' ]
     239                $settings[ 'read_more_text' ],
     240                esc_attr( $settings['read_more_class'] )
    240241            ));
    241242        }
  • wp-show-posts/trunk/readme.txt

    r1815911 r1893043  
    55Requires at least: 4.5
    66Tested up to: 4.9
    7 Stable tag: 1.1.2
     7Stable tag: 1.1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050* Include title
    5151* Read more text
     52* Read more button class
    5253
    5354= Meta =
     
    162163
    163164== 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)
    164173
    165174= 1.1.2 =
     
    200209* Use manual excerpt if it's set
    201210
    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 
    255211== 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)
    256220
    257221= 1.1.2 =
     
    291255* Add margin to the top of pagination
    292256* 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
  • wp-show-posts/trunk/wp-show-posts.php

    r1815911 r1893043  
    44Plugin URI: https://wpshowposts.com
    55Description: 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
     6Version: 1.1.3
    77Author: Tom Usborne
    88Author URI: https://tomusborne.com
     
    1818
    1919// Define the current version
    20 define( 'WPSP_VERSION', '1.1.2' );
     20define( 'WPSP_VERSION', '1.1.3' );
    2121
    2222// Add resizer script
     
    143143        'post_meta_bottom_style' => sanitize_text_field( wpsp_get_setting( $id, 'wpsp_post_meta_bottom_style' ) ),
    144144        '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' ) ),
    145146    ) );
    146147
     
    366367    $wrapper_id = ' id="wpsp-' . $id . '"';
    367368
    368     $wrapper_atts = apply_filters( 'wpsp_wrapper_atts', '' );
     369    $wrapper_atts = apply_filters( 'wpsp_wrapper_atts', '', $settings );
    369370
    370371    do_action( 'wpsp_before_wrapper', $settings );
     
    404405            }
    405406
     407            $post_classes = implode( ' ', $settings[ 'inner_wrapper_class' ] );
     408
    406409            // 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            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            }
    410419
    411420            // Start inner container
    412421            printf( '<%1$s class="%2$s" itemtype="http://schema.org/%3$s" itemscope>',
    413422                $settings[ 'inner_wrapper' ],
    414                 implode( ' ', $settings[ 'inner_wrapper_class' ] ) . $column_class . $featured,
     423                $post_classes . $column_class . $featured,
    415424                $settings[ 'itemtype' ]
    416425            );
Note: See TracChangeset for help on using the changeset viewer.