Changeset 3860 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 05/01/2012 10:08:50 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r3855 r3860 1214 1214 * @uses bbp_is_topic_anonymous() To check if the topic is by an 1215 1215 * anonymous user 1216 * @uses bbp_get_topic_author_url() To get the topic author url 1216 1217 * @uses bbp_get_topic_author_avatar() To get the topic author avatar 1217 * @uses bbp_get_topic_author_url() To get the topic author url 1218 * @uses bbp_get_topic_author_display_name() To get the topic author display 1219 * name 1220 * @uses bbp_get_user_display_role() To get the topic author display role 1221 * @uses bbp_get_topic_author_id() To get the topic author id 1218 1222 * @uses apply_filters() Calls 'bbp_get_topic_author_link' with the link 1219 1223 * and args … … 1226 1230 'type' => 'both', 1227 1231 'size' => 80, 1228 'sep' => ' ' 1232 'sep' => ' ', 1233 'show_role' => true 1229 1234 ); 1230 1235 $r = bbp_parse_args( $args, $defaults, 'get_topic_author_link' ); … … 1272 1277 $author_link[] = sprintf( '<a href="%1$s"%2$s%3$s>%4$s</a>', $author_url, $link_title, $link_class, $link_text ); 1273 1278 } 1279 1280 if ( true === $show_role ) { 1281 $author_link[] = bbp_get_topic_author_role( array( 'topic_id' => $topic_id ) ); 1282 } 1283 1274 1284 $author_link = join( $sep, $author_link ); 1275 1285 … … 1384 1394 return apply_filters( 'bbp_get_topic_author_email', $author_email, $topic_id ); 1385 1395 } 1396 1397 /** 1398 * Output the topic author role 1399 * 1400 * @since bbPress (r3860) 1401 * 1402 * @param array $args Optional. 1403 * @uses bbp_get_topic_author_role() To get the topic author role 1404 */ 1405 function bbp_topic_author_role( $args = array() ) { 1406 echo bbp_get_topic_author_role( $args ); 1407 } 1408 /** 1409 * Return the topic author role 1410 * 1411 * @since bbPress (r3860) 1412 * 1413 * @param array $args Optional. 1414 * @uses bbp_get_topic_id() To get the topic id 1415 * @uses bbp_get_user_display_role() To get the user display role 1416 * @uses bbp_get_topic_author_id() To get the topic author id 1417 * @uses apply_filters() Calls bbp_get_topic_author_role with the author 1418 * role & args 1419 * @return string topic author role 1420 */ 1421 function bbp_get_topic_author_role( $args = array() ) { 1422 $defaults = array( 1423 'topic_id' => 0, 1424 'class' => 'bbp-author-role', 1425 'before' => '', 1426 'after' => '' 1427 ); 1428 $args = bbp_parse_args( $args, $defaults, 'get_topic_author_role' ); 1429 extract( $args, EXTR_SKIP ); 1430 1431 $topic_id = bbp_get_topic_id( $topic_id ); 1432 $role = bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ); 1433 $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $before, $class, $role, $after ); 1434 1435 return apply_filters( 'bbp_get_topic_author_role', $author_role, $args ); 1436 } 1437 1386 1438 1387 1439 /**
Note: See TracChangeset
for help on using the changeset viewer.