Changeset 1496433
- Timestamp:
- 09/15/2016 05:41:52 PM (10 years ago)
- Location:
- authors-page
- Files:
-
- 3 added
- 2 edited
-
tags/1.5 (added)
-
tags/1.5/authors-page.php (added)
-
tags/1.5/readme.txt (added)
-
trunk/authors-page.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
authors-page/trunk/authors-page.php
r1477089 r1496433 4 4 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. 5 5 Author: wpchefgadget 6 Version: 1. 56 Version: 1.6 7 7 */ 8 8 … … 15 15 16 16 $the_page_title = 'Authors'; 17 17 18 18 if( get_page_by_path( strtolower( $the_page_title ) ) !== null ) { 19 19 return; … … 54 54 } 55 55 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' ) 57 57 { 58 58 global $wp_query; … … 87 87 'blog_id' => $GLOBALS['blog_id'], 88 88 'role' => $role, 89 'orderby' => 'post_count',90 'order' => 'DESC',89 'orderby' => $orderby, 90 'order' => $order, 91 91 ); 92 92 … … 173 173 $post_counter = isset( $atts['counter']) ? $atts['counter'] : ''; 174 174 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 ); 176 185 } 177 186 -
authors-page/trunk/readme.txt
r1477089 r1496433 4 4 Tags: users list, table of users, list of users, avatars, usernames, authors list, authors page, authors, WP Biographia 5 5 Requires at least: 3.5.2 6 Tested up to: 4. 5.37 Stable tag: 1. 56 Tested up to: 4.6.1 7 Stable tag: 1.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 The users are ordered by post number, from highest to lowest. 19 19 You 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%)"` 20 Use the `orderby="name"` attribute to show the users sorted by their display name (the "Display name publicly as" field from the profile page). 20 21 21 22 In 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. … … 29 30 30 31 == 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/ 31 34 = 1.5 = 32 35 * The "counter" attribute supports the %post% placeholder now.
Note: See TracChangeset
for help on using the changeset viewer.