Plugin Directory

Changeset 1496433


Ignore:
Timestamp:
09/15/2016 05:41:52 PM (10 years ago)
Author:
Aimbox
Message:

Version 1.6

Location:
authors-page
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • authors-page/trunk/authors-page.php

    r1477089 r1496433  
    44    Description: Displays all users of a certain role on one page in a table format. It also shows their avatars and usernames with linking to their detailed information.
    55    Author: wpchefgadget
    6     Version: 1.5
     6    Version: 1.6
    77    */
    88
     
    1515
    1616        $the_page_title = 'Authors';
    17        
     17
    1818        if( get_page_by_path( strtolower( $the_page_title ) ) !== null ) {
    1919            return;
     
    5454    }
    5555
    56     function uvd_aup_render_authors_page( $role = null, $post_counter = '' )
     56    function uvd_aup_render_authors_page( $role = null, $post_counter = '', $orderby = 'post_count', $order = 'DESC' )
    5757    {
    5858        global $wp_query;
     
    8787            'blog_id'       => $GLOBALS['blog_id'],
    8888            'role'          => $role,
    89             'orderby'       => 'post_count',
    90             'order'         => 'DESC',
     89            'orderby'       => $orderby,
     90            'order'         => $order,
    9191        );
    9292
     
    173173        $post_counter = isset( $atts['counter']) ? $atts['counter'] : '';
    174174
    175         return uvd_aup_render_authors_page( $role, $post_counter );
     175        $orderby = 'post_count';
     176        $order = 'DESC';
     177
     178        if ( !empty( $atts['orderby'] ) && $atts['orderby'] == 'name' )
     179        {
     180            $orderby = 'display_name';
     181            $order = 'ASC';
     182        }
     183
     184        return uvd_aup_render_authors_page( $role, $post_counter, $orderby, $order );
    176185    }
    177186
  • authors-page/trunk/readme.txt

    r1477089 r1496433  
    44Tags: users list, table of users, list of users, avatars, usernames, authors list, authors page, authors, WP Biographia
    55Requires at least: 3.5.2
    6 Tested up to: 4.5.3
    7 Stable tag: 1.5
     6Tested up to: 4.6.1
     7Stable tag: 1.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818The users are ordered by post number, from highest to lowest.
    1919You can also display the number of posts made by a user by adding the "counter" attribute, like this: `[authors_page role="editor" counter="post"]` In the "counter" attribute you can use the %post% placeholder to customize the look of the counter. For example `counter="# of posts is %post%"` will display this: "# of posts is 123" where 123 is the number of posts made by a user. The old syntax - `counter="post"` - is still supported and is the same as this: `counter="(%post%)"`
     20Use the `orderby="name"` attribute to show the users sorted by their display name (the "Display name publicly as" field from the profile page).
    2021
    2122In order to view more details about a user in the table, you just have to click on the corresponding username and all available information will be displayed. This feature is enabled by the WP Biographia plugin IF it is already installed. Otherwise the default WordPress functionality will be used.
     
    2930
    3031== Changelog ==
     32= 1.6 =
     33* The orderby="name" attribute is added to sort the authors by their display name. https://wordpress.org/support/topic/does-it-work-for-woocommerce/
    3134= 1.5 =
    3235* The "counter" attribute supports the %post% placeholder now.
Note: See TracChangeset for help on using the changeset viewer.