This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
/
functions.php
73 lines (58 loc) · 1.74 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* Functions that may be used across a variety of components, so they should always
* be loaded for use on the front end of the site.
*
* @todo Decide whether Template Tags is a useful enough component to stand alone.
* The Widgets and Shortcodes components both require the use of these functions here,
* which should be template tags.
*
* @package Members
*/
/**
* Displays the login form.
*
* @since 0.1.0
* @deprecated 0.2.0 Use wp_login_form() instead.
*/
function members_login_form() {
wp_login_form( array( 'echo' => true ) );
}
/**
* Creates the login form.
*
* @since 0.1.0
* @deprecated 0.2.0 Use wp_login_form() instead.
*/
function members_get_login_form( $args = array() ) {
wp_login_form( array( echo => 'false' ) );
}
/**
* Function for listing users like the WordPress function currently uses for authors.
*
* Eventually, I hope to remove this function in favor of wp_list_users():
* @link http://core.trac.wordpress.org/ticket/15145
*
* @since 0.1
* @uses get_users()
*/
function members_list_users( $args = array() ) {
$output = '';
$users = get_users( $args );
if ( !empty( $users ) ) {
$output .= '<ul class="xoxo members-list-users">';
foreach ( $users as $user ) {
$url = get_author_posts_url( $author->ID, $author->user_nicename );
$class = "user-{$user->ID}";
if ( is_author( $user->ID ) )
$class .= ' current-user';
$output .= "<li class='{$class}'><a href='{$url}' title='" . esc_attr( $user->display_name ) . "'>{$user->display_name}</a></li>\n";
}
$output .= '</ul>';
}
$output = apply_filters( 'members_list_users', $output );
if ( empty( $args['echo'] ) )
return $output;
echo $output;
}
?>