Plugin Directory

Changeset 537752


Ignore:
Timestamp:
04/28/2012 09:59:19 PM (14 years ago)
Author:
kaser
Message:

updating plugin to 1.5

Location:
akfeatured-post-widget
Files:
2 edited
5 copied

Legend:

Unmodified
Added
Removed
  • akfeatured-post-widget/trunk/ak_featured_post.php

    r534525 r537752  
    44Plugin URI: http://cssboss.com/featured_post
    55Description: Easily configure this widget to display any amount of posts (from 1 to 99) from a category into any widgetized area of your blog. Video is more my style, so check out this video tutorial I made for the plugin <a href="http://www.youtube.com/watch?v=eWhafkO7uJQ">Here</a>
    6 Version: 1.4.1
     6Version: 1.5
    77Author: Andrew Kaser
    88Author URI: http://www.andrewkaser.com
     
    5858            if (isset($instance['show_featured_image'])){ $show_featured_image = $instance['show_featured_image']; } else { $show_featured_image = __('checked','text_domain'); }
    5959            if (isset($instance['show_support_link'])){ $show_support_link = $instance['show_support_link']; } else { $show_support_link = __('checked','text_domain'); }
     60            if (isset($instance['order_post'])){ $order_post = $instance['order_post']; } else { $order_post = __('DESC','text_domain'); }
     61           
    6062            ?>
    6163            <p>
     
    6365                <input class="widefat" id="<?php echo $this->get_field_id( 'show_post_limit' ); ?>" name="<?php echo $this->get_field_name( 'show_post_limit' ); ?>" type="text" value="<?php echo esc_attr( $show_post_limit ); ?>" maxlength="2" style="width: 25px;" />
    6466            </p>
    65            
     67            <p>
     68                <label for="<?php echo $this->get_field_id('order_post'); ?>"><?php _e('Order Posts:'); ?></label>
     69                <select id="<?php echo $this->get_field_id( 'order_post' ); ?>" name="<?php echo $this->get_field_name( 'order_post' ); ?>" >
     70                    <option value="ASC" <?php if ( $order_post == "ASC" ) { echo 'selected="selected"'; } ?>>Oldest to Newest</option>
     71                    <option value="DESC" <?php if ( $order_post == "DESC" ) { echo 'selected="selected"'; } ?>>Newest to Oldest</option>
     72                </select>
     73            </p>
    6674            <p>
    6775                <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
     
    107115                <input id="<?php echo $this->get_field_id( 'show_support_link' ); ?>" name="<?php echo $this->get_field_name( 'show_support_link' ); ?>" type="checkbox" value="<?php echo esc_attr( $show_support_link ); ?>" <?php checked( (bool) $show_support_link, true ); ?> />
    108116            </p>
     117            <p><a href="http://csss.boss.com/donate">Donate</a> - <a href="http://www.cssboss.com">CSSBoss.com</a></p>
    109118            <?php
    110119        }
     
    115124            $instance = array();
    116125            $instance['show_post_limit'] = strip_tags( $new_instance['show_post_limit'] );
     126            $instance['order_post'] = strip_tags( $new_instance['order_post']);
    117127            $instance['category'] = strip_tags( $new_instance['category'] );
    118128            $instance['link_title_to_cat'] = ( isset( $new_instance['link_title_to_cat'] ) ? 1 : 0 );
     
    135145            $title = apply_filters( 'widget_title', $instance['title'] );
    136146            $category = $instance['category'];
     147            $order_post = $instance['order_post'];
    137148            $link_title_to_cat = $instance['link_title_to_cat'];
    138149            $show_post_title = $instance['show_post_title'];
     
    151162            }
    152163           
    153             $ak_featured_posts_query = new WP_Query( 'cat='.$category.'&showposts='.$show_post_limit ); // get new post data
     164            echo "<ul>"; // thanks Dan ;)
     165           
     166            $ak_featured_posts_query = new WP_Query( 'cat='.$category.'&showposts='.$show_post_limit.'&order='.$order_post ); // get new post data
    154167            while ( $ak_featured_posts_query->have_posts() ) : $ak_featured_posts_query->the_post();       
    155168                $image_title = get_the_title();  // The alt text for the featured image
     
    158171                        <a href="<?php the_permalink(); ?>">
    159172                            <?php
    160                                 if ($show_post_title)
     173                                if ($show_post_title) // To show the title of the post, or not... That is the question
    161174                                {
    162                                     the_title(); // To show the title of the post, or not... That is the question
     175                                    the_title();
    163176                                }
    164177                   
     
    181194             endwhile;
    182195           
     196            echo "</ul>";
     197           
    183198            if ( $show_support_link )
    184199            {
  • akfeatured-post-widget/trunk/readme.txt

    r534525 r537752  
    55Requires at least: 3.3.1
    66Tested up to: 3.3.2
    7 Stable tag: 1.4.1
     7Stable tag: 1.5
    88
    99A widget that you can use to display posts from a category
     
    5656== Change Log ==
    5757
     58= 1.5 =
     59Included proper html syntax
     60Added ordering of post by either ascending or descending
     61
    5862= 1.4.1 =
    5963It's a secret bwahhahaha
     
    8185== Upgrade Notice ==
    8286
     87= 1.5 =
     88Order your post, Select specific posts, display proper html, upgrading is a must!
     89
    8390= 1.3 =
    8491Added additional functionality, and fixed a few bugs!
Note: See TracChangeset for help on using the changeset viewer.