Changeset 6056 for trunk/src/includes/users/template.php
- Timestamp:
- 06/05/2016 06:27:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/template.php
r6032 r6056 2110 2110 return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval ); 2111 2111 } 2112 2113 /** Moderators ****************************************************************/ 2114 2115 /** 2116 * Output the moderators of a forum 2117 * 2118 * @since 2.6.0 bbPress 2119 * 2120 * @param int $forum_id Optional. Topic id 2121 * @param array $args See {@link bbp_get_moderator_list()} 2122 * @uses bbp_get_moderator_list() To get the moderator list 2123 */ 2124 function bbp_moderator_list( $forum_id = 0, $args = array() ) { 2125 echo bbp_get_moderator_list( $forum_id, $args ); 2126 } 2127 2128 /** 2129 * Return the moderators for an object 2130 * 2131 * @since 2.6.0 bbPress 2132 * 2133 * @param int $object_id Optional. Object id 2134 * @param array $args This function supports these arguments: 2135 * - before: Before the tag list 2136 * - sep: Tag separator 2137 * - after: After the tag list 2138 * 2139 * @return string Moderator list of the object 2140 */ 2141 function bbp_get_moderator_list( $object_id = 0, $args = array() ) { 2142 2143 // Parse arguments against default values 2144 $r = bbp_parse_args( $args, array( 2145 'before' => '<div class="bbp-moderators"><p>' . esc_html__( 'Moderators:', 'bbpress' ) . ' ', 2146 'sep' => ', ', 2147 'after' => '</p></div>', 2148 'none' => '' 2149 ), 'get_moderator_list' ); 2150 2151 // Get forum moderators 2152 $user_ids = bbp_get_moderator_ids( $object_id ); 2153 if ( ! empty( $user_ids ) ) { 2154 2155 // In admin, use nicenames 2156 if ( is_admin() ) { 2157 $users = bbp_get_user_nicenames_from_ids( $user_ids ); 2158 2159 // In theme, use display names & profile links 2160 } else { 2161 foreach ( $user_ids as $user_id ) { 2162 $users[] = bbp_get_user_profile_link( $user_id ); 2163 } 2164 } 2165 2166 $retval = $r['before'] . implode( $r['sep'], $users ) . $r['after']; 2167 2168 // No forum moderators 2169 } else { 2170 $retval = $r['none']; 2171 } 2172 2173 return apply_filters( 'bbp_get_moderator_list', $retval ); 2174 }
Note: See TracChangeset
for help on using the changeset viewer.