Changeset 4679
- Timestamp:
- 01/02/2013 02:01:22 PM (13 years ago)
- Location:
- trunk/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/core/filters.php
r4656 r4679 197 197 add_filter( 'bbp_get_replymove_template', 'bbp_add_template_locations' ); 198 198 199 // Topic and reply author display names 200 add_filter( 'bbp_get_topic_author_display_name', 'wptexturize' ); 201 add_filter( 'bbp_get_topic_author_display_name', 'convert_chars' ); 202 add_filter( 'bbp_get_topic_author_display_name', 'esc_html' ); 203 add_filter( 'bbp_get_reply_author_display_name', 'wptexturize' ); 204 add_filter( 'bbp_get_reply_author_display_name', 'convert_chars' ); 205 add_filter( 'bbp_get_reply_author_display_name', 'esc_html' ); 206 199 207 /** 200 208 * Add filters to anonymous post author data -
trunk/includes/replies/template-tags.php
r4673 r4679 953 953 $author_name = __( 'Anonymous', 'bbpress' ); 954 954 955 return apply_filters( 'bbp_get_reply_author_display_name', esc_attr( $author_name ), $reply_id ); 955 // Encode possible UTF8 display names 956 if ( seems_utf8( $author_name ) === false ) 957 $author_name = utf8_encode( $author_name ); 958 959 return apply_filters( 'bbp_get_reply_author_display_name', $author_name, $reply_id ); 956 960 } 957 961 … … 1051 1055 } 1052 1056 1057 // Reply ID is good 1053 1058 if ( !empty( $reply_id ) ) { 1059 1060 // Tweak link title if empty 1054 1061 if ( empty( $$r['link_title'] ) ) { 1055 1062 $link_title = sprintf( !bbp_is_reply_anonymous( $reply_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_reply_author_display_name( $reply_id ) ); 1063 1064 // Use what was passed if not 1065 } else { 1066 $link_title = $r['link_title']; 1056 1067 } 1057 1068 1058 $link_title = !empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : ''; 1059 $author_url = bbp_get_reply_author_url( $reply_id ); 1060 $anonymous = bbp_is_reply_anonymous( $reply_id ); 1069 $link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : ''; 1070 $author_url = bbp_get_reply_author_url( $reply_id ); 1071 $anonymous = bbp_is_reply_anonymous( $reply_id ); 1072 $author_links = array(); 1061 1073 1062 1074 // Get avatar … … 1070 1082 } 1071 1083 1084 // Link class 1085 $link_class = ' class="bbp-author-' . $r['type'] . '"'; 1086 1072 1087 // Add links if not anonymous 1073 if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $reply_id ) ) ) { 1088 if ( empty( $anonymous ) && bbp_user_has_profile( bbp_get_reply_author_id( $topic_id ) ) ) { 1089 1090 // Assemble the links 1074 1091 foreach ( $author_links as $link => $link_text ) { 1075 1092 $link_class = ' class="bbp-author-' . $link . '"'; … … 1078 1095 1079 1096 if ( true === $r['show_role'] ) { 1080 $author_link[] = bbp_get_reply_author_role( array( ' reply_id' => $reply_id ) );1097 $author_link[] = bbp_get_reply_author_role( array( 'topic_id' => $topic_id ) ); 1081 1098 } 1082 1099 -
trunk/includes/topics/template-tags.php
r4673 r4679 1263 1263 $author_name = __( 'Anonymous', 'bbpress' ); 1264 1264 1265 return apply_filters( 'bbp_get_topic_author_display_name', esc_attr( $author_name ), $topic_id ); 1265 // Encode possible UTF8 display names 1266 if ( seems_utf8( $author_name ) === false ) 1267 $author_name = utf8_encode( $author_name ); 1268 1269 return apply_filters( 'bbp_get_topic_author_display_name', $author_name, $topic_id ); 1266 1270 } 1267 1271 … … 1367 1371 if ( empty( $r['link_title'] ) ) { 1368 1372 $link_title = sprintf( !bbp_is_topic_anonymous( $topic_id ) ? __( 'View %s\'s profile', 'bbpress' ) : __( 'Visit %s\'s website', 'bbpress' ), bbp_get_topic_author_display_name( $topic_id ) ); 1373 1374 // Use what was passed if not 1375 } else { 1376 $link_title = $r['link_title']; 1369 1377 } 1370 1378 1371 $ r['link_title'] = !empty( $r['link_title'] ) ? ' title="' . $r['link_title']. '"' : '';1372 $author_url 1373 $anonymous 1374 $author_links 1379 $link_title = !empty( $link_title ) ? ' title="' . $link_title . '"' : ''; 1380 $author_url = bbp_get_topic_author_url( $topic_id ); 1381 $anonymous = bbp_is_topic_anonymous( $topic_id ); 1382 $author_links = array(); 1375 1383 1376 1384 // Get avatar
Note: See TracChangeset
for help on using the changeset viewer.