Changeset 953230
- Timestamp:
- 07/23/2014 04:52:36 AM (10 years ago)
- Location:
- super-post
- Files:
-
- 35 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
super-post/trunk/readme.txt
r873188 r953230 4 4 Tags: 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 5 5 Requires at least: 3.0 6 Tested up to: 3. 87 Stable tag: 1.1. 16 Tested up to: 3. 7 Stable tag: 1.1. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 92 92 == Changelog == 93 93 94 95 96 94 97 = 1.1.1 = 95 98 * Fix plugin settings page -
super-post/trunk/super-post.php
r873188 r953230 4 4 Plugin URI: http://zourbuth.com/?p=862 5 5 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. 16 Version: 1.1. 7 7 Author: zourbuth 8 8 Author URI: http://zourbuth.com … … 39 39 40 40 // Set constant variable 41 define( 'SUPER_POST_VERSION', '1.1. 1' );41 define( 'SUPER_POST_VERSION', '1.1.' ); 42 42 define( 'SUPER_POST_DIR', plugin_dir_path( __FILE__ ) ); 43 43 define( 'SUPER_POST_URL', plugin_dir_url( __FILE__ ) ); -
super-post/trunk/utility.php
r808617 r953230 72 72 $html = ''; 73 73 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() ) : 79 78 $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; 87 92 88 93 return $html; … … 132 137 * @since 1.0.0 133 138 */ 134 function sp_generate_post_list( $ post, $args ){135 139 function sp_generate_post_list( $args ){ 140 global $post; 136 141 extract( $args, EXTR_SKIP ); 137 142 … … 249 254 * @since 1.0.0 250 255 */ 251 function s p_get_posts($args){256 function s($args){ 252 257 253 258 extract( $args, EXTR_SKIP ); 259 254 260 $posts = array(); 261 255 262 if ($query == 'recent') { 256 263 $q = array( … … 277 284 ); 278 285 } elseif ($query == 'pingbacked') { 279 / * on demand */286 / 280 287 281 288 } elseif ($query == 'related') { … … 354 361 } 355 362 356 $posts = get_posts( $q ); 357 358 if( $posts ) 359 return $posts; 360 else 361 return false; 363 return $q; 362 364 } 363 365 … … 379 381 $args['offset'] = (int) $_POST['offset']; 380 382 381 $posts = s p_get_posts($args);383 $posts = s($args); 382 384 383 385 // Ok then, lets we proceed the posts into the template. … … 385 387 $html = ''; 386 388 foreach( $posts as $post ) { 387 $html .= sp_generate_post_list( $ post, $args );389 $html .= sp_generate_post_list( $args ); 388 390 } 389 391 }
Note: See TracChangeset
for help on using the changeset viewer.