View difference between Paste ID: hRL1K8YU and TFvibaPR
SHOW: | | - or go back to the newest paste.
1
<?php
2
/**
3
 * BuddyPress - Members Loop
4
 *
5
 * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
6
 *
7
 * @package BuddyPress
8
 * @subpackage bp-legacy
9
 */
10
11
/**
12
 * Fires before the display of the members loop.
13
 *
14
 * @since 1.2.0
15
 */
16
do_action( 'bp_before_members_loop' ); ?>
17
18-
<?php while ( bp_members() ) : bp_the_member();
18+
19-
$user = new WP_User( bp_get_member_user_id() );
19+
20-
if ( $user->roles[0] != ‘testing’ ) :
20+
21
22
<?php
23
$test_role_array = get_users( array( 'fields' => 'ID', 'role' => 'testing' ) );
24
$test_role_csv = implode(",", $test_role_array).
25
$exclude_testing = '&exclude=' . $test_role_csv;
26
?>
27-
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
27+
28
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . $exclude_members ) ) : ?>
29
30
	<div id="pag-top" class="pagination">
31
32
		<div class="pag-count" id="member-dir-count-top">
33
34
			<?php bp_members_pagination_count(); ?>
35
36
		</div>
37
38
		<div class="pagination-links" id="member-dir-pag-top">
39
40
			<?php bp_members_pagination_links(); ?>
41
42
		</div>
43
44
	</div>
45
46
	<?php
47
48
	/**
49
	 * Fires before the display of the members list.
50
	 *
51
	 * @since 1.1.0
52
	 */
53
	do_action( 'bp_before_directory_members_list' ); ?>
54
55
	<ul id="members-list" class="item-list">
56
57
	<?php while ( bp_members() ) : bp_the_member(); ?>
58-
		<?php
58+
59-
      $test_role_array = get_users( array( 'fields' => 'ID', 'role' => 'testing' ) );
59+
60
			<div class="item-avatar">
61-
$exclude_testing = 'exclude=' . $test_role_csv;
61+
62
			</div>
63-
if ( bp_has_members( $exclude_testing ) )  // etc
63+
64
			<div class="item">
65-
      	?>
65+
66
					<a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a>
67
68
					<?php if ( bp_get_member_latest_update() ) : ?>
69
70
						<span class="update"> <?php bp_member_latest_update(); ?></span>
71
72
					<?php endif; ?>
73
74
				</div>
75
76
				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
77
78
				<?php
79
80
				/**
81
				 * Fires inside the display of a directory member item.
82
				 *
83
				 * @since 1.1.0
84
				 */
85
				do_action( 'bp_directory_members_item' ); ?>
86
87
				<?php
88
				 /***
89
				  * If you want to show specific profile fields here you can,
90
				  * but it'll add an extra query for each member in the loop
91
				  * (only one regardless of the number of fields you show):
92
				  *
93
				  * bp_member_profile_data( 'field=the field name' );
94
				  */
95
				?>
96
			</div>
97
98
			<div class="action">
99
100
				<?php
101
102
				/**
103
				 * Fires inside the members action HTML markup to display actions.
104
				 *
105
				 * @since 1.1.0
106
				 */
107
				do_action( 'bp_directory_members_actions' ); ?>
108
109
			</div>
110
111
			<div class="clear"></div>
112
		</li>
113
114
	<?php endwhile; ?>
115
116
	</ul>
117
118
	<?php
119
120
	/**
121
	 * Fires after the display of the members list.
122
	 *
123
	 * @since 1.1.0
124
	 */
125
	do_action( 'bp_after_directory_members_list' ); ?>
126
127
	<?php bp_member_hidden_fields(); ?>
128
129
	<div id="pag-bottom" class="pagination">
130
131
		<div class="pag-count" id="member-dir-count-bottom">
132
133
			<?php bp_members_pagination_count(); ?>
134
135
		</div>
136
137
		<div class="pagination-links" id="member-dir-pag-bottom">
138
139
			<?php bp_members_pagination_links(); ?>
140
141
		</div>
142
143
	</div>
144
145
<?php else: ?>
146
147
	<div id="message" class="info">
148
		<p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
149
	</div>
150
151
<?php endif; ?>
152
153
<?php
154
155
/**
156
 * Fires after the display of the members loop.
157
 *
158
 * @since 1.2.0
159
 */
160
do_action( 'bp_after_members_loop' ); ?>