Plugin Directory

Changeset 1491155


Ignore:
Timestamp:
09/06/2016 02:03:02 PM (10 years ago)
Author:
flocsy
Message:

2.4.4 added order by: random

Location:
authors/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • authors/trunk/authors.php

    r929950 r1491155  
    44Plugin URI: http://blog.fleischer.hu/wordpress/authors/
    55Description: Authors Widget shows the list or cloud of the authors, with the number of posts, link to RSS feed next to their name, avatar. It is useful in a multi-author blog, where you want to have the list in the sidemenu.
    6 Version: 2.4.3
     6Version: 2.4.4
    77Author: Gavriel Fleischer
    88Author URI: http://blog.fleischer.hu/author/gavriel/
     
    4444        $bC = is_array($matches) && count($matches) >= 2 ? intval($matches[1]) : 0;
    4545        return $aC < $bC ? 1 : -1;
     46    }
     47
     48    function widget_authors_sort_by_random($a, $b) {
     49        return rand(-1,1);
    4650    }
    4751
     
    6165        case 'id':
    6266            usort($authors, widget_authors_sort_by_id);
     67            break;
     68        case 'random':
     69            usort($authors, widget_authors_sort_by_random);
    6370            break;
    6471#       case 'posts':
     
    464471            <label for="authors-order-<?php echo $number; ?>-posts"><input type="radio" class="radio" id="authors-order-<?php echo $number; ?>-posts" name="widget-authors[<?php echo $number; ?>][order]" value="posts"<?php echo 'posts' == $order ? ' checked="checked"' : '' ?> />&nbsp;<?php _e('Post count','authors') ?></label>
    465472            <label for="authors-order-<?php echo $number; ?>-id"><input type="radio" class="radio" id="authors-order-<?php echo $number; ?>-id" name="widget-authors[<?php echo $number; ?>][order]" value="id"<?php echo 'id' == $order ? ' checked="checked"' : '' ?> />&nbsp;<?php _e('ID','authors') ?></label>
     473            <label for="authors-order-<?php echo $number; ?>-random"><input type="radio" class="radio" id="authors-order-<?php echo $number; ?>-random" name="widget-authors[<?php echo $number; ?>][order]" value="random"<?php echo 'random' == $order ? ' checked="checked"' : '' ?> />&nbsp;<?php _e('random','authors') ?></label>
    466474        </p>
    467475        <p><label for="authors-limit-<?php echo $number; ?>"><?php _e('Number of authors to show', 'authors') ?>: <input type="text" class="widefat" style="width: 25px; text-align: center;" id="authors-limit-<?php echo $number; ?>" name="widget-authors[<?php echo $number; ?>][limit]" value="<?php echo $limit ?>" /></label></p>
  • authors/trunk/readme.txt

    r929950 r1491155  
    44Tags: authors, author, multi-author, multi-user, list, sidemenu, sidebar, links, widgets, widget, plugin, avatar, gravatar
    55Requires at least: 2.0.2
    6 Tested up to: 3.8.1
     6Tested up to: 4.2.2
    77Stable tag: trunk
    88
     
    28281. Title
    29292. Format: list | cloud | dropdown
    30 3. Order by: name | post count
     303. Order by: display name | first name | last name | post count | id | random
    31314. Number of authors to show
    32325. Show Avatar
     
    8686
    8787== Changelog ==
     88
     89= 2.4.4 =
     90* Added order by: random
    8891
    8992= 2.4.3 =
Note: See TracChangeset for help on using the changeset viewer.