Changeset 9272
- Timestamp:
- 12/24/2014 02:32:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r9260 r9272 31 31 */ 32 32 function bp_get_members_slug() { 33 34 /** 35 * Filters the Members component slug. 36 * 37 * @since BuddyPress (1.5.0) 38 * 39 * @param string $slug Members component slug. 40 */ 33 41 return apply_filters( 'bp_get_members_slug', buddypress()->members->slug ); 34 42 } … … 52 60 */ 53 61 function bp_get_members_root_slug() { 62 63 /** 64 * Filters the Members component root slug. 65 * 66 * @since BuddyPress (1.5.0) 67 * 68 * @param string $slug Members component root slug. 69 */ 54 70 return apply_filters( 'bp_get_members_root_slug', buddypress()->members->root_slug ); 55 71 } … … 73 89 */ 74 90 function bp_get_members_directory_permalink() { 91 92 /** 93 * Filters the member directory permalink. 94 * 95 * @since BuddyPress (1.5.0) 96 * 97 * @param string $value Members directory permalink. 98 */ 75 99 return apply_filters( 'bp_get_members_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) ); 76 100 } … … 104 128 } 105 129 130 /** 131 * Filters the sign-up slug. 132 * 133 * @since BuddyPress (1.5.0) 134 * 135 * @param string $slug Sign-up slug. 136 */ 106 137 return apply_filters( 'bp_get_signup_slug', $slug ); 107 138 } … … 135 166 } 136 167 168 /** 169 * Filters the activation slug. 170 * 171 * @since BuddyPress (1.5.0) 172 * 173 * @param string $slug Activation slug. 174 */ 137 175 return apply_filters( 'bp_get_activate_slug', $slug ); 138 176 } … … 351 389 return true; 352 390 } elseif ( $this->current_member + 1 == $this->member_count ) { 391 392 /** 393 * Fires right before the rewinding of members listing. 394 * 395 * @since BuddyPress (1.5.0) 396 */ 353 397 do_action('member_loop_end'); 354 398 // Do some cleaning up after the loop … … 375 419 376 420 // loop has just started 377 if ( 0 == $this->current_member ) 421 if ( 0 == $this->current_member ) { 422 423 /** 424 * Fires if the current member is the first in the loop. 425 * 426 * @since BuddyPress (1.5.0) 427 */ 378 428 do_action( 'member_loop_start' ); 429 } 430 379 431 } 380 432 } … … 500 552 ); 501 553 554 /** 555 * Filters whether or not BuddyPress has members to iterate over. 556 * 557 * @since BuddyPress (1.2.4) 558 * 559 * @param bool $value Whether or not there are members to iterate over. 560 * @param array $members_template Populated $members_template global. 561 */ 502 562 return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template ); 503 563 } … … 554 614 $pag = sprintf( _n( 'Viewing 1 member', 'Viewing %1$s - %2$s of %3$s members', $members_template->total_member_count, 'buddypress' ), $from_num, $to_num, $total ); 555 615 616 /** 617 * Filters the members pagination count. 618 * 619 * @since BuddyPress (1.5.0) 620 * 621 * @param string $pag Pagination count string. 622 */ 556 623 return apply_filters( 'bp_members_pagination_count', $pag ); 557 624 } … … 571 638 global $members_template; 572 639 640 /** 641 * Filters the members pagination link. 642 * 643 * @since BuddyPress (1.2.0) 644 * 645 * @param string $pag_links HTML markup for pagination links. 646 */ 573 647 return apply_filters( 'bp_get_members_pagination_links', $members_template->pag_links ); 574 648 } … … 590 664 global $members_template; 591 665 $member_id = isset( $members_template->member->id ) ? (int) $members_template->member->id : false; 666 667 /** 668 * Filters the ID of the current member in the loop. 669 * 670 * @since BuddyPress (1.2.0) 671 * 672 * @param int $member_id ID of the member being iterated over. 673 */ 592 674 return apply_filters( 'bp_get_member_user_id', $member_id ); 593 675 } … … 627 709 } 628 710 711 /** 712 * Filters the determined classes to add to the HTML element. 713 * 714 * @since BuddyPress (1.7.0) 715 * 716 * @param string $classes Classes to be added to the HTML element. 717 */ 629 718 $classes = apply_filters( 'bp_get_member_class', $classes ); 630 719 $classes = array_merge( $classes, array() ); … … 647 736 function bp_get_member_user_nicename() { 648 737 global $members_template; 738 739 /** 740 * Filters the nicename of the current member in the loop. 741 * 742 * @since BuddyPress (1.2.5) 743 * 744 * @param string $user_nicename Nicename for the current member. 745 */ 649 746 return apply_filters( 'bp_get_member_user_nicename', $members_template->member->user_nicename ); 650 747 } … … 663 760 function bp_get_member_user_login() { 664 761 global $members_template; 762 763 /** 764 * Filters the login of the current member in the loop. 765 * 766 * @since BuddyPress (1.2.5) 767 * 768 * @param string $user_login Login for the current member. 769 */ 665 770 return apply_filters( 'bp_get_member_user_login', $members_template->member->user_login ); 666 771 } … … 679 784 function bp_get_member_user_email() { 680 785 global $members_template; 786 787 /** 788 * Filters the email address of the current member in the loop. 789 * 790 * @since BuddyPress (1.2.5) 791 * 792 * @param string $user_email Email addres for the current member. 793 */ 681 794 return apply_filters( 'bp_get_member_user_email', $members_template->member->user_email ); 682 795 } … … 689 802 function bp_member_is_loggedin_user() { 690 803 global $members_template; 804 805 /** 806 * Filters whether the current member in the loop is the logged-in user. 807 * 808 * @since BuddyPress (1.2.5) 809 * 810 * @param bool $value Whether current member in the loop is logged in. 811 */ 691 812 return apply_filters( 'bp_member_is_loggedin_user', bp_loggedin_user_id() == $members_template->member->id ? true : false ); 692 813 } … … 700 821 */ 701 822 function bp_member_avatar( $args = '' ) { 823 824 /** 825 * Filters a members avatar. 826 * 827 * @since BuddyPress (1.2.0) 828 * 829 * @param string $value Formatted HTML <img> element, 830 * or raw avatar URL based on $html arg 831 */ 702 832 echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) ); 703 833 } … … 739 869 extract( $r, EXTR_SKIP ); 740 870 871 /** 872 * Filters a members avatar. 873 * 874 * @since BuddyPress (1.2.0) 875 * 876 * @param string $value Formatted HTML <img> element, 877 * or raw avatar URL based on $html arg 878 */ 741 879 return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) ); 742 880 } … … 756 894 global $members_template; 757 895 896 /** 897 * Filters the permalink for the current member in the loop. 898 * 899 * @since BuddyPress (1.2.0) 900 * 901 * @param string $value Permalink for the current member in the loop. 902 */ 758 903 return apply_filters( 'bp_get_member_permalink', bp_core_get_user_domain( $members_template->member->id, $members_template->member->user_nicename, $members_template->member->user_login ) ); 759 904 } … … 773 918 */ 774 919 function bp_member_name() { 920 921 /** 922 * Filters the display name of current member in the loop. 923 * 924 * @since BuddyPress (1.2.0) 925 * 926 * @param string $value Display name for current member. 927 */ 775 928 echo apply_filters( 'bp_member_name', bp_get_member_name() ); 776 929 } … … 807 960 } 808 961 962 /** 963 * Filters the display name of current member in the loop. 964 * 965 * @since BuddyPress (1.2.0) 966 * 967 * @param string $fullname Display name for current member. 968 */ 809 969 return apply_filters( 'bp_get_member_name', $members_template->member->fullname ); 810 970 } … … 859 1019 } 860 1020 861 // Filter and return 1021 /** 1022 * Filters the current members last active time. 1023 * 1024 * @since BuddyPress (1.2.0) 1025 * 1026 * @param string $last_activity Formatted time since last activity. 1027 * @param array $r Array of parsed arguments for query. 1028 */ 862 1029 return apply_filters( 'bp_member_last_active', $last_activity, $r ); 863 1030 } … … 894 1061 return false; 895 1062 1063 /** 1064 * Filters the excerpt of the latest update for current member in the loop. 1065 * 1066 * @since BuddyPress (1.2.5) 1067 * 1068 * @param string $value Excerpt of the latest update for current member in the loop. 1069 */ 896 1070 $update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) ); 897 1071 … … 906 1080 } 907 1081 1082 /** 1083 * Filters the latest update from the current member in the loop. 1084 * 1085 * @since BuddyPress (1.2.0) 1086 * 1087 * @param string $update_content Formatted latest update for current member. 1088 */ 908 1089 return apply_filters( 'bp_get_member_latest_update', $update_content ); 909 1090 } … … 981 1162 } 982 1163 1164 /** 1165 * Filters resulting piece of member profile data. 1166 * 1167 * @since BuddyPress (1.2.0) 1168 * 1169 * @param string|bool $data Profile data if found, otherwise false. 1170 */ 983 1171 return apply_filters( 'bp_get_member_profile_data', $data ); 984 1172 } … … 1000 1188 $registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, _x( 'registered %s', 'Records the timestamp that the user registered into the activy stream', 'buddypress' ) ) ); 1001 1189 1190 /** 1191 * Filters the 'registered [x days ago]' string for the current member. 1192 * 1193 * @since BuddyPress (2.1.0) 1194 * 1195 * @param string $registered The 'registered [x days ago]' string. 1196 */ 1002 1197 return apply_filters( 'bp_member_registered', $registered ); 1003 1198 } … … 1043 1238 </form>'; 1044 1239 1240 /** 1241 * Filters the Members component search form. 1242 * 1243 * @since BuddyPress (1.9.0) 1244 * 1245 * @param string $search_form_html HTML markup for the member search form. 1246 */ 1045 1247 echo apply_filters( 'bp_directory_members_search_form', $search_form_html ); 1046 1248 } … … 1058 1260 */ 1059 1261 function bp_get_total_site_member_count() { 1262 1263 /** 1264 * Filters the total site member count. 1265 * 1266 * @since BuddyPress (1.2.0) 1267 * 1268 * @param int $value Number-formatted total site member count. 1269 */ 1060 1270 return apply_filters( 'bp_get_total_site_member_count', bp_core_number_format( bp_core_get_total_member_count() ) ); 1061 1271 } … … 1138 1348 } 1139 1349 1350 /** 1351 * Filters the navigation markup for the displayed user. 1352 * 1353 * This is a dynamic filter that is dependent on the navigation tab component being rendered. 1354 * 1355 * @since BuddyPress (1.1.0) 1356 * 1357 * @param string $value Markup for the tab list item including link. 1358 * @param array $user_nav_item Array holding parts used to construct tab list item. 1359 * Passed by reference. 1360 */ 1140 1361 echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) ); 1141 1362 } … … 1183 1404 extract( $r, EXTR_SKIP ); 1184 1405 1406 /** 1407 * Filters the logged in user's avatar. 1408 * 1409 * @since BuddyPress (1.1.0) 1410 * 1411 * @param string $value User avatar string. 1412 */ 1185 1413 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); 1186 1414 } … … 1225 1453 extract( $r, EXTR_SKIP ); 1226 1454 1455 /** 1456 * Filters the displayed user's avatar. 1457 * 1458 * @since BuddyPress (1.1.0) 1459 * 1460 * @param string $value User avatar string. 1461 */ 1227 1462 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); 1228 1463 } … … 1248 1483 $retval = ''; 1249 1484 1485 /** 1486 * Filters the email address of the displayed user. 1487 * 1488 * @since BuddyPress (1.5.0) 1489 * 1490 * @param string $retval Email address for displayed user. 1491 */ 1250 1492 return apply_filters( 'bp_get_displayed_user_email', esc_attr( $retval ) ); 1251 1493 } … … 1259 1501 */ 1260 1502 function bp_last_activity( $user_id = 0 ) { 1503 1504 /** 1505 * Filters the 'active [x days ago]' string for a user. 1506 * 1507 * @since BuddyPress (1.0.0) 1508 * 1509 * @param string $value Formatted 'active [x days ago]' string. 1510 */ 1261 1511 echo apply_filters( 'bp_last_activity', bp_get_last_activity( $user_id ) ); 1262 1512 } … … 1274 1524 $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('active %s', 'buddypress') ); 1275 1525 1526 /** 1527 * Filters the 'active [x days ago]' string for a user. 1528 * 1529 * @since BuddyPress (1.5.0) 1530 * 1531 * @param string $value Formatted 'active [x days ago]' string. 1532 */ 1276 1533 return apply_filters( 'bp_get_last_activity', $last_activity ); 1277 1534 } … … 1305 1562 $fullname = (array) explode( ' ', $name ); 1306 1563 1564 /** 1565 * Filters the first name of a user. 1566 * 1567 * @since BuddyPress (1.2.0) 1568 * 1569 * @param string $value First name of user. 1570 * @param string $fullname Full name of user. 1571 */ 1307 1572 return apply_filters( 'bp_get_user_firstname', $fullname[0], $fullname ); 1308 1573 } … … 1320 1585 */ 1321 1586 function bp_get_loggedin_user_link() { 1587 1588 /** 1589 * Filters the link for the logged-in user's profile. 1590 * 1591 * @since BuddyPress (1.2.4) 1592 * 1593 * @param string $value Link for the logged-in user's profile. 1594 */ 1322 1595 return apply_filters( 'bp_get_loggedin_user_link', bp_loggedin_user_domain() ); 1323 1596 } … … 1335 1608 */ 1336 1609 function bp_get_displayed_user_link() { 1610 1611 /** 1612 * Filters the link for the displayed user's profile. 1613 * 1614 * @since BuddyPress (1.2.4) 1615 * 1616 * @param string $value Link for the displayed user's profile. 1617 */ 1337 1618 return apply_filters( 'bp_get_displayed_user_link', bp_displayed_user_domain() ); 1338 1619 } … … 1357 1638 function bp_displayed_user_domain() { 1358 1639 global $bp; 1640 1641 /** 1642 * Filters the generated link for the displayed user's profile. 1643 * 1644 * @since BuddyPress (1.0.0) 1645 * 1646 * @param string $value Generated link for the displayed user's profile. 1647 */ 1359 1648 return apply_filters( 'bp_displayed_user_domain', isset( $bp->displayed_user->domain ) ? $bp->displayed_user->domain : '' ); 1360 1649 } … … 1367 1656 function bp_loggedin_user_domain() { 1368 1657 global $bp; 1658 1659 /** 1660 * Filters the generated link for the logged-in user's profile. 1661 * 1662 * @since BuddyPress (1.0.0) 1663 * 1664 * @param string $value Generated link for the logged-in user's profile. 1665 */ 1369 1666 return apply_filters( 'bp_loggedin_user_domain', isset( $bp->loggedin_user->domain ) ? $bp->loggedin_user->domain : '' ); 1370 1667 } … … 1383 1680 function bp_get_displayed_user_fullname() { 1384 1681 global $bp; 1682 1683 /** 1684 * Filters the displayed user's display name. 1685 * 1686 * @since BuddyPress (1.2.0) 1687 * 1688 * @param string $value Displayed user's display name. 1689 */ 1385 1690 return apply_filters( 'bp_displayed_user_fullname', isset( $bp->displayed_user->fullname ) ? $bp->displayed_user->fullname : '' ); 1386 1691 } … … 1405 1710 function bp_get_loggedin_user_fullname() { 1406 1711 global $bp; 1712 1713 /** 1714 * Filters the logged-in user's display name. 1715 * 1716 * @since BuddyPress (1.0.0) 1717 * 1718 * @param string $value Logged-in user's display name. 1719 */ 1407 1720 return apply_filters( 'bp_get_loggedin_user_fullname', isset( $bp->loggedin_user->fullname ) ? $bp->loggedin_user->fullname : '' ); 1408 1721 } … … 1428 1741 } 1429 1742 1743 /** 1744 * Filters the username of the displayed user. 1745 * 1746 * @since BuddyPress (1.2.0) 1747 * 1748 * @param string $username Username of the displayed user. 1749 */ 1430 1750 return apply_filters( 'bp_get_displayed_user_username', $username ); 1431 1751 } … … 1451 1771 } 1452 1772 1773 /** 1774 * Filters the username of the logged-in user. 1775 * 1776 * @since BuddyPress (1.2.0) 1777 * 1778 * @param string $username Username of the logged-in user. 1779 */ 1453 1780 return apply_filters( 'bp_get_loggedin_user_username', $username ); 1454 1781 } … … 1492 1819 } 1493 1820 1821 /** 1822 * Filters the URL to the signup page. 1823 * 1824 * @since BuddyPress (1.1.0) 1825 * 1826 * @param string $page URL to the signup page. 1827 */ 1494 1828 return apply_filters( 'bp_get_signup_page', $page ); 1495 1829 } … … 1531 1865 } 1532 1866 1867 /** 1868 * Filters the URL of the activation page. 1869 * 1870 * @since BuddyPress (1.2.0) 1871 * 1872 * @param string $page URL to the activation page. 1873 */ 1533 1874 return apply_filters( 'bp_get_activation_page', $page ); 1534 1875 } … … 1552 1893 $value = $_POST['signup_username']; 1553 1894 1895 /** 1896 * Filters the username submitted during signup. 1897 * 1898 * @since BuddyPress (1.1.0) 1899 * 1900 * @param string $value Username submitted during signup. 1901 */ 1554 1902 return apply_filters( 'bp_get_signup_username_value', $value ); 1555 1903 } … … 1573 1921 $value = $_POST['signup_email']; 1574 1922 1923 /** 1924 * Filters the email address submitted during signup. 1925 * 1926 * @since BuddyPress (1.1.0) 1927 * 1928 * @param string $value Email address submitted during signup. 1929 */ 1575 1930 return apply_filters( 'bp_get_signup_email_value', $value ); 1576 1931 } … … 1592 1947 $value = $_POST['signup_with_blog']; 1593 1948 1949 /** 1950 * Filters the 'signup_with_blog' value submitted during signup. 1951 * 1952 * @since BuddyPress (1.1.0) 1953 * 1954 * @param string $value 'signup_with_blog' value submitted during signup. 1955 */ 1594 1956 return apply_filters( 'bp_get_signup_with_blog_value', $value ); 1595 1957 } … … 1613 1975 $value = $_POST['signup_blog_url']; 1614 1976 1977 /** 1978 * Filters the 'signup_blog_url' value submitted during signup. 1979 * 1980 * @since BuddyPress (1.1.0) 1981 * 1982 * @param string $value 'signup_blog_url' value submitted during signup. 1983 */ 1615 1984 return apply_filters( 'bp_get_signup_blog_url_value', $value ); 1616 1985 } … … 1639 2008 $subdomain_base = apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path ); 1640 2009 2010 /** 2011 * Filters the base URL for subdomain installations of WordPress Multisite. 2012 * 2013 * @since BuddyPress (2.1.0) 2014 * 2015 * @param string $subdomain_base The base URL - eg, 'example.com' for 2016 * site_url() example.com or www.example.com. 2017 */ 1641 2018 return apply_filters( 'bp_signup_subdomain_base', $subdomain_base ); 1642 2019 } … … 1660 2037 $value = $_POST['signup_blog_title']; 1661 2038 2039 /** 2040 * Filters the 'signup_blog_title' value submitted during signup. 2041 * 2042 * @since BuddyPress (1.1.0) 2043 * 2044 * @param string $value 'signup_blog_title' value submitted during signup. 2045 */ 1662 2046 return apply_filters( 'bp_get_signup_blog_title_value', $value ); 1663 2047 } … … 1681 2065 $value = $_POST['signup_blog_privacy']; 1682 2066 2067 /** 2068 * Filters the 'signup_blog_privacy' value submitted during signup. 2069 * 2070 * @since BuddyPress (1.1.0) 2071 * 2072 * @param string $value 'signup_blog_privacy' value submitted during signup. 2073 */ 1683 2074 return apply_filters( 'bp_get_signup_blog_privacy_value', $value ); 1684 2075 } … … 1710 2101 $signup_avatar_dir = false; 1711 2102 2103 /** 2104 * Filters the avatar dir used during signup. 2105 * 2106 * @since BuddyPress (1.1.0) 2107 * 2108 * @param string|bool $signup_avatar_dir Avatar dir used during signup or false. 2109 */ 1712 2110 return apply_filters( 'bp_get_signup_avatar_dir_value', $signup_avatar_dir ); 1713 2111 } … … 1790 2188 $default_grav = $bp->grav_default->user; 1791 2189 1792 // Create 2190 /** 2191 * Filters the base Gravatar url used for signup avatars when no avatar dir found. 2192 * 2193 * @since BuddyPress (1.0.2) 2194 * 2195 * @param string $value Gravatar url to use. 2196 */ 1793 2197 $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' ); 1794 2198 $md5_lcase_email = md5( strtolower( bp_get_signup_email_value() ) ); … … 1796 2200 } 1797 2201 2202 /** 2203 * Filters the user avatar during signup. 2204 * 2205 * @since BuddyPress (1.1.0) 2206 * 2207 * @param string $gravatar_img Avatar HTML image tag. 2208 * @param array $args Array of parsed args for avatar query. 2209 */ 1798 2210 return apply_filters( 'bp_get_signup_avatar', $gravatar_img, $args ); 1799 2211 } … … 1832 2244 } 1833 2245 2246 /** 2247 * Filters whether or not new signups are allowed. 2248 * 2249 * @since BuddyPress (1.5.0) 2250 * 2251 * @param bool $signup_allowed Whether or not new signups are allowed. 2252 */ 1834 2253 return apply_filters( 'bp_get_signup_allowed', $signup_allowed ); 1835 2254 }
Note: See TracChangeset
for help on using the changeset viewer.