mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 05:34:07 +01:00
Add exclude and include to wp_list_authors().
props patricknami. fixes #9902. Built from https://develop.svn.wordpress.org/trunk@27274 git-svn-id: http://core.svn.wordpress.org/trunk@27130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2abdda257c
commit
2d8e1ca5b0
@ -316,6 +316,8 @@ function get_author_posts_url($author_id, $author_nicename = '') {
|
|||||||
* or as a string.</li>
|
* or as a string.</li>
|
||||||
* <li>html (bool) (true): Whether to list the items in html form or plaintext.
|
* <li>html (bool) (true): Whether to list the items in html form or plaintext.
|
||||||
* </li>
|
* </li>
|
||||||
|
* <li>exclude (array): Array of user IDs to explicitly exclude.</li>
|
||||||
|
* <li>include (array): Array of user IDs to explicitly include.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @link http://codex.wordpress.org/Template_Tags/wp_list_authors
|
* @link http://codex.wordpress.org/Template_Tags/wp_list_authors
|
||||||
@ -331,7 +333,7 @@ function wp_list_authors($args = '') {
|
|||||||
'optioncount' => false, 'exclude_admin' => true,
|
'optioncount' => false, 'exclude_admin' => true,
|
||||||
'show_fullname' => false, 'hide_empty' => true,
|
'show_fullname' => false, 'hide_empty' => true,
|
||||||
'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
|
'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
|
||||||
'style' => 'list', 'html' => true
|
'style' => 'list', 'html' => true, 'exclude' => '', 'include' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
@ -339,7 +341,7 @@ function wp_list_authors($args = '') {
|
|||||||
|
|
||||||
$return = '';
|
$return = '';
|
||||||
|
|
||||||
$query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number' ) );
|
$query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number', 'exclude', 'include' ) );
|
||||||
$query_args['fields'] = 'ids';
|
$query_args['fields'] = 'ids';
|
||||||
$authors = get_users( $query_args );
|
$authors = get_users( $query_args );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user