Plugin Directory

Changeset 1177287


Ignore:
Timestamp:
06/09/2015 08:26:23 AM (11 years ago)
Author:
eugenyh
Message:

Version 0.6.6 released

Location:
advanced-recent-posts/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-recent-posts/trunk/lptw-recent-posts.php

    r1166332 r1177287  
    55Description: Plugin that shows the recent posts with thumbnails in the widget and in other parts of the your blog or theme with shortcodes.
    66Tags: widget, posts, plugin, recent, recent posts, latest, latest posts, shortcode, thumbnail, thumbnails, categories, content, featured image, Taxonomy, custom post type, custom
    7 Version: 0.6.5
     7Version: 0.6.6
    88Author: Eugene Holin
    99Author URI: http://lp-tricks.com/
     
    1717    wp_enqueue_style( 'lptw-style' );
    1818
    19     wp_enqueue_script( 'jquery-masonry' );
    20 
    21     wp_enqueue_script( 'lptw-recent-posts-script', plugins_url( 'lptw-recent-posts.js', __FILE__ ), array(), '0.5', true );
     19    wp_enqueue_script( 'lptw-recent-posts-script', plugins_url( 'lptw-recent-posts.js', __FILE__ ), array('jquery', 'jquery-masonry'), '0.5', true );
    2220}
    23 
    2421add_action( 'wp_enqueue_scripts', 'lptw_recent_posts_register_scripts' );
    2522
     
    3027
    3128/* trim excerpt to custom size */
    32 function custom_excerpt ($limit) {
     29function lptw_custom_excerpt ($limit) {
    3330      $excerpt = explode(' ', get_the_excerpt(), $limit);
    3431      if (count($excerpt)>=$limit) {
     
    945942**/
    946943
    947 // all-news-small-thumb
    948 
    949944function lptw_display_recent_posts ( $atts ) {
    950945    $default_posts_per_page =  get_option( 'posts_per_page', '10' );
     
    10201015    }
    10211016
    1022     $args = array(
     1017    $lptw_shortcode_query_args = array(
    10231018        'post_type'             => $a['post_type'],
    10241019        'posts_per_page'        => $a['posts_per_page'],
     
    10351030        );
    10361031
    1037     $allnews = new WP_Query( $args );
    1038     if( $allnews->have_posts() ) {
    1039         if ($a['reverse_post_order'] == 'true') { $allnews->posts = array_reverse($allnews->posts); }
     1032    $lptw_shortcode_query = new WP_Query( $lptw_shortcode_query_args );
     1033    if( $lptw_shortcode_query->have_posts() ) {
     1034        if ($a['reverse_post_order'] == 'true') { $lptw_shortcode_query->posts = array_reverse($lptw_shortcode_query->posts); }
    10401035        $i=0;
    10411036        $content = '';
    10421037        if ($a['layout'] == 'grid-medium') {$content .= '<div id="grid-container">';}
    1043         while( $allnews->have_posts() ) {
    1044             $allnews->the_post();
     1038        while( $lptw_shortcode_query->have_posts() ) {
     1039            $lptw_shortcode_query->the_post();
    10451040
    10461041            $post_id = get_the_ID();
     
    11781173                        $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'">' . $my_excerpt . '</content>';
    11791174                    } else {
    1180                         $my_excerpt = custom_excerpt(35);
     1175                        $my_excerpt = lptw_custom_excerpt(35);
    11811176                        $content .= '<content class="post-excerpt content-'.$a['color_scheme'].'">' . $my_excerpt . '</content>';
    11821177                    }
     
    11861181
    11871182            $i++;
    1188         } // end while( $allnews->have_posts() )
     1183        } // end while( $lptw_shortcode_query->have_posts() )
    11891184        if ($a['layout'] == 'grid-medium') {$content .= '</div>';}
    1190         return $content;
    11911185    } else {
    1192         return __( 'No recent posts', 'lptw_recent_posts_domain' );
     1186        $content = __( 'No recent posts', 'lptw_recent_posts_domain' );
    11931187    }
     1188    wp_reset_postdata();
     1189    return $content;
    11941190}
    11951191
     
    12081204    wp_enqueue_style('lptw-recent-posts-backend-style' );
    12091205
    1210     // Add the color picker css and js files
     1206    // Add the color picker css styles
    12111207    wp_enqueue_style( 'wp-color-picker' );
    1212     wp_enqueue_script( 'wp-color-picker' );
    12131208
    12141209    wp_enqueue_script( 'lptw-shortcode-builder-script', plugins_url ( 'backend/lptw-recent-posts-shortcode-builder.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
     
    12191214
    12201215    wp_enqueue_script( 'chosen-script', plugins_url ( 'backend/chosen/chosen.jquery.min.js', __FILE__ ), array(), '1.4.2', true );
    1221 
    1222     // Include our custom jQuery file with WordPress Color Picker dependency
    1223     //wp_enqueue_script( 'custom-script-handle', plugins_url( 'custom-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
    12241216}
    12251217add_action( 'admin_enqueue_scripts', 'lptw_recent_posts_backend_scripts' );
    12261218
    12271219/* include shortcode builder  */
    1228 //include( plugin_dir_path( __FILE__ ) . 'backend/color-picker.php');
    12291220include( plugin_dir_path( __FILE__ ) . 'backend/lptw-recent-posts-backend.php');
    12301221
  • advanced-recent-posts/trunk/readme.txt

    r1166332 r1177287  
    44Requires at least: 3.5
    55Tested up to: 4.2.2
    6 Stable tag: 0.6.5
     6Stable tag: 0.6.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080== Changelog ==
    8181
     82= 0.6.6 =
     83* Fixed issue with incorrect interaction with other posts, comments, plug-ins, etc., which displays the content on the same page, which is inserted a shortcode.
     84
    8285= 0.6.5 =
    8386* Changes in the widgets and shortcodes - now you can exclude the Posts without Featured Image from the Posts list.
Note: See TracChangeset for help on using the changeset viewer.