Plugin Directory

Changeset 953230

Timestamp:
07/23/2014 04:52:36 AM (10 years ago)
Author:
zourbuth
Message:

update to 1.1.2

Location:
super-post
Files:
35 added
3 edited

Legend:

Unmodified
Added
Removed
  • super-post/trunk/readme.txt

    r873188 r953230  
    44Tags: post, posts, recent, popular, comment, thumbnail, featured image, post query, term, sort, order, excerpt, date, post date, date format, post author, author, template, related, sticky, tag, category, widget, sidebar, post new, rate, rating, post rating, like, likes, post likes, view, views, post views, search, search post, share, post share, facebook, facebook likes, facebook share, twitter, twitter share, email share, google plus
    55Requires at least: 3.0
    6 Tested up to: 3.8
    7 Stable tag: 1.1.1
     6Tested up to: 3.
     7Stable tag: 1.1.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9292== Changelog ==
    9393
     94
     95
     96
    9497= 1.1.1 =
    9598* Fix plugin settings page
  • super-post/trunk/super-post.php

    r873188 r953230  
    44    Plugin URI: http://zourbuth.com/?p=862
    55    Description: A complete posts and custom posts processing for your content, sidebar or even template files for displaying it in a better way. With highly customization and easy to use, it only takes seconds to create your posts or custom post list.
    6     Version: 1.1.1
     6    Version: 1.1.
    77    Author: zourbuth
    88    Author URI: http://zourbuth.com
     
    3939
    4040    // Set constant variable
    41     define( 'SUPER_POST_VERSION', '1.1.1' );
     41    define( 'SUPER_POST_VERSION', '1.1.' );
    4242    define( 'SUPER_POST_DIR', plugin_dir_path( __FILE__ ) );
    4343    define( 'SUPER_POST_URL', plugin_dir_url( __FILE__ ) );
  • super-post/trunk/utility.php

    r808617 r953230  
    7272    $html = '';
    7373   
    74     $posts = sp_get_posts($arg);
    75    
    76     // Ok then, lets we proceed the posts into the template.
    77     if ( !empty($posts) ) {
    78 
     74    $q = super_post_query( $arg );
     75    $wp_query = new WP_Query( $q );
     76   
     77    if ( $wp_query->have_posts() ) :
    7978        $html .= "<ul class='super-post template-$template'>";
    80 
    81         foreach($posts as $post) {
    82             $html .= sp_generate_post_list( $post, $arg );
    83         }
    84        
    85         $html.= '</ul>';
    86     }
     79       
     80        while ( $wp_query->have_posts() ) :
     81            $wp_query->the_post();         
     82            $html .= sp_generate_post_list( $arg );             
     83        endwhile;
     84       
     85        $html.= '</ul>';       
     86       
     87        wp_reset_postdata(); // reset the post globals as this query will shakes the party
     88    else:   
     89        if( current_user_can('manage_options') )
     90            $html.= __( 'There is no post for the current settings.', SUPER_POST_TEXTDOMAIN );
     91    endif;
    8792   
    8893    return $html;
     
    132137 * @since 1.0.0
    133138 */
    134 function sp_generate_post_list( $post, $args ){
    135 
     139function sp_generate_post_list( $args ){
     140    global $post;
    136141    extract( $args, EXTR_SKIP );
    137142   
     
    249254 * @since 1.0.0
    250255 */
    251 function sp_get_posts($args){
     256function s($args){
    252257
    253258    extract( $args, EXTR_SKIP );
     259
    254260    $posts = array();
     261
    255262    if ($query == 'recent') {
    256263        $q = array(
     
    277284        );         
    278285    } elseif ($query == 'pingbacked') {
    279         /* on demand */
     286        /
    280287   
    281288    } elseif ($query == 'related') {
     
    354361    }
    355362   
    356     $posts = get_posts( $q );
    357    
    358     if( $posts )
    359         return $posts;
    360     else
    361         return false;
     363    return $q;
    362364}
    363365
     
    379381    $args['offset'] = (int) $_POST['offset'];
    380382
    381     $posts = sp_get_posts($args);
     383    $posts = s($args);
    382384   
    383385    // Ok then, lets we proceed the posts into the template.
     
    385387        $html = '';
    386388        foreach( $posts as $post ) {
    387             $html .= sp_generate_post_list( $post, $args );
     389            $html .= sp_generate_post_list( $args );
    388390        }
    389391    }
Note: See TracChangeset for help on using the changeset viewer.