Changeset 6438 for trunk/src/includes/users/template.php
- Timestamp:
- 05/27/2017 05:04:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/template.php
r6427 r6438 191 191 $bbp->user_query = new BBP_User_Query( $r ); 192 192 193 // Filter & return 193 194 return apply_filters( 'bbp_has_users', $bbp->user_query->have_users(), $bbp->user_query ); 194 195 } … … 270 271 } 271 272 273 // Filter & return 272 274 return (int) apply_filters( 'bbp_get_user_id', (int) $bbp_user_id, $displayed_user_fallback, $current_user_fallback ); 273 275 } … … 293 295 */ 294 296 function bbp_get_current_user_id() { 295 return apply_filters( 'bbp_get_current_user_id', bbp_get_user_id( 0, false, true ) ); 297 298 // Filter & return 299 return (int) apply_filters( 'bbp_get_current_user_id', bbp_get_user_id( 0, false, true ) ); 296 300 } 297 301 … … 316 320 */ 317 321 function bbp_get_displayed_user_id() { 322 323 // Filter & return 318 324 return apply_filters( 'bbp_get_displayed_user_id', bbp_get_user_id( 0, true, false ) ); 319 325 } … … 368 374 $user->filter = $old_filter; 369 375 370 // Return empty376 // Filter & return 371 377 return apply_filters( 'bbp_get_displayed_user_field', $value, $field, $filter ); 372 378 } … … 394 400 global $user_identity; 395 401 396 $current_user_name = is_user_logged_in() ? $user_identity : __( 'Anonymous', 'bbpress' ); 397 402 $current_user_name = is_user_logged_in() 403 ? $user_identity 404 : esc_html__( 'Anonymous', 'bbpress' ); 405 406 // Filter & return 398 407 return apply_filters( 'bbp_get_current_user_name', $current_user_name ); 399 408 } … … 434 443 $avatar = get_avatar( $user, $size ); 435 444 445 // Filter & return 436 446 return apply_filters( 'bbp_get_current_user_avatar', $avatar, $size ); 437 447 } … … 472 482 $user_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 473 483 484 // Filter & return 474 485 return apply_filters( 'bbp_get_user_profile_link', $user_link, $user_id ); 475 486 } … … 524 535 $retval = ! empty( $nicename ) ? ( $r['before'] . $nicename . $r['after'] ) : ''; 525 536 526 // Filter andreturn537 // Filter & return 527 538 return (string) apply_filters( 'bbp_get_user_nicename', $retval, $user_id, $r ); 528 539 } … … 588 599 } 589 600 601 // Filter & return 590 602 return apply_filters( 'bbp_get_user_profile_url', $url, $user_id, $user_nicename ); 591 603 } … … 625 637 $user = get_userdata( $user_id ); 626 638 $edit_link = '<a href="' . esc_url( bbp_get_user_profile_edit_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 639 640 // Filter & return 627 641 return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id ); 628 642 } … … 684 698 } 685 699 700 // Filter & return 686 701 return apply_filters( 'bbp_get_user_edit_profile_url', $url, $user_id, $user_nicename ); 687 688 702 } 689 703 … … 736 750 } 737 751 752 // Filter & return 738 753 return apply_filters( 'bbp_get_user_display_role', $role, $user_id ); 739 754 } … … 784 799 $retval = $r['before'] . '<a href="' . esc_url( admin_url() ) . '">' . $r['text'] . '</a>' . $r['after']; 785 800 801 // Filter & return 786 802 return apply_filters( 'bbp_get_admin_link', $retval, $r ); 787 803 } … … 831 847 } 832 848 849 // Filter & return 833 850 return apply_filters( 'bbp_get_author_ip', $author_ip, $r ); 834 851 } … … 889 906 } 890 907 908 // Filter & return 891 909 return apply_filters( 'bbp_get_author_display_name', $retval, $post_id ); 892 910 } … … 945 963 } 946 964 965 // Filter & return 947 966 return apply_filters( 'bbp_get_author_email', $retval, $post_id ); 948 967 } … … 1001 1020 } 1002 1021 1022 // Filter & return 1003 1023 return apply_filters( 'bbp_get_author_url', $retval, $post_id ); 1004 1024 } … … 1080 1100 } 1081 1101 1102 // Filter & return 1082 1103 return apply_filters( 'bbp_get_favorites_permalink', $url, $user_id ); 1083 1104 } … … 1191 1212 } 1192 1213 1193 // Return the link1214 // Filter & return 1194 1215 return apply_filters( 'bbp_get_user_favorites_link', $html, $r, $user_id, $topic_id ); 1195 1216 } … … 1281 1302 } 1282 1303 1304 // Filter & return 1283 1305 return apply_filters( 'bbp_get_subscriptions_permalink', $url, $user_id ); 1284 1306 } … … 1435 1457 } 1436 1458 1437 // Return the link1459 // Filter & return 1438 1460 return apply_filters( 'bbp_get_user_subscribe_link', $html, $r, $user_id, $topic_id ); 1439 1461 } … … 1603 1625 function bbp_edit_user_blog_role() { 1604 1626 1605 // Returnif no user is being edited1627 // Bail if no user is being edited 1606 1628 if ( ! bbp_is_single_user_edit() ) { 1607 1629 return; … … 1635 1657 function bbp_edit_user_forums_role() { 1636 1658 1637 // Returnif no user is being edited1659 // Bail if no user is being edited 1638 1660 if ( ! bbp_is_single_user_edit() ) { 1639 1661 return; … … 1679 1701 $contact_methods = wp_get_user_contact_methods( bbpress()->displayed_user ); 1680 1702 1681 return apply_filters( 'bbp_edit_user_contact_methods', $contact_methods ); 1703 // Filter & return 1704 return (array) apply_filters( 'bbp_edit_user_contact_methods', $contact_methods ); 1682 1705 } 1683 1706 … … 1735 1758 } 1736 1759 1760 // Filter & return 1737 1761 return apply_filters( 'bbp_get_user_topics_created_url', $url, $user_id ); 1738 1762 } … … 1791 1815 } 1792 1816 1817 // Filter & return 1793 1818 return apply_filters( 'bbp_get_user_replies_created_url', $url, $user_id ); 1794 1819 } … … 1847 1872 } 1848 1873 1874 // Filter & return 1849 1875 return apply_filters( 'bbp_get_user_engagements_url', $url, $user_id ); 1850 1876 } … … 2105 2131 } 2106 2132 2133 // Filter & return 2107 2134 return apply_filters( 'bbp_get_author_link', $author_link, $r ); 2108 2135 } … … 2157 2184 2158 2185 // Forum is hidden, and user can see it 2159 } elseif ( bbp_is_forum_hidden 2186 } elseif ( bbp_is_forum_hidden( $forum_id, $r['check_ancestors'] ) && user_can( $user_id, 'read_forum', $forum_id ) ) { 2160 2187 $retval = true; 2161 2188 } 2162 2189 2190 // Filter & return 2163 2191 return apply_filters( 'bbp_user_can_view_forum', $retval, $forum_id, $user_id ); 2164 2192 } … … 2196 2224 } 2197 2225 2198 // Allow access to be filtered2226 // Filter & return 2199 2227 return (bool) apply_filters( 'bbp_current_user_can_publish_topics', $retval ); 2200 2228 } … … 2226 2254 } 2227 2255 2228 // Allow access to be filtered2256 // Filter & return 2229 2257 return (bool) apply_filters( 'bbp_current_user_can_publish_forums', $retval ); 2230 2258 } … … 2262 2290 } 2263 2291 2264 // Allow access to be filtered2292 // Filter & return 2265 2293 return (bool) apply_filters( 'bbp_current_user_can_publish_replies', $retval ); 2266 2294 } … … 2303 2331 } 2304 2332 2333 // Filter & return 2305 2334 return apply_filters( 'bbp_get_forums_for_current_user', $forums, $r, $args ); 2306 2335 } … … 2336 2365 } 2337 2366 2338 // Allow access to be filtered2367 // Filter & return 2339 2368 return (bool) apply_filters( 'bbp_current_user_can_access_create_forum_form', (bool) $retval ); 2340 2369 } … … 2372 2401 } 2373 2402 2374 // Allow access to be filtered2403 // Filter & return 2375 2404 return (bool) apply_filters( 'bbp_current_user_can_access_create_topic_form', (bool) $retval ); 2376 2405 } … … 2408 2437 } 2409 2438 2410 // Allow access to be filtered2439 // Filter & return 2411 2440 return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval ); 2412 2441 } … … 2444 2473 } 2445 2474 2446 // Allow access to be filtered2475 // Filter & return 2447 2476 return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval ); 2448 2477 } … … 2508 2537 } 2509 2538 2539 // Filter & return 2510 2540 return apply_filters( 'bbp_get_moderator_list', $retval ); 2511 2541 }
Note: See TracChangeset
for help on using the changeset viewer.