Changeset 9877 for trunk/src/bp-members/bp-members-functions.php
- Timestamp:
- 05/19/2015 01:40:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-functions.php
r9819 r9877 2 2 3 3 /** 4 * BuddyPress Member Functions 4 * BuddyPress Member Functions. 5 5 * 6 6 * Functions specific to the members component. … … 76 76 * bp_use_legacy_user_query value, returning true. 77 77 * 78 * @param array $args {78 * @param array|string $args { 79 79 * Array of arguments. All are optional. See {@link BP_User_Query} for 80 80 * a more complete description of arguments. … … 86 86 * @type string $meta_value Limit to users with a meta_value (with meta_key). Default: false. 87 87 * @type array|string $member_type Array or comma-separated string of member types. 88 * @type mixed $includeLimit results by user IDs. Default: false.88 * @type mixed $include Limit results by user IDs. Default: false. 89 89 * @type int $per_page Results per page. Default: 20. 90 90 * @type int $page Page of results. Default: 1. … … 154 154 * Return the domain for the passed user: e.g. http://example.com/members/andy/. 155 155 * 156 * @param int $user_id The ID of the user. 157 * @param string $user_nicename Optional. user_nicename of the user. 158 * @param string $user_login Optional. user_login of the user. 156 * @param int $user_id The ID of the user. 157 * @param string|bool $user_nicename Optional. user_nicename of the user. 158 * @param string|bool $user_login Optional. user_login of the user. 159 * 160 * @return string 159 161 */ 160 162 function bp_core_get_user_domain( $user_id = 0, $user_nicename = false, $user_login = false ) { … … 194 196 * 195 197 * @param int $user_id The ID of the user. 198 * 196 199 * @return array 197 200 */ … … 224 227 * 225 228 * @param string $user_login user_login of the user being queried. 229 * 226 230 * @return int 227 231 */ … … 236 240 * 237 241 * @param string $username user_login to check. 242 * 238 243 * @return int|null The ID of the matched user on success, null on failure. 239 244 */ … … 262 267 * 263 268 * @param string $user_nicename user_nicename to check. 269 * 264 270 * @return int|null The ID of the matched user on success, null on failure. 265 271 */ … … 288 294 * so it will return the user_login or user_nicename as appropriate. 289 295 * 290 * @param int $user_id User ID to check. 291 * @param string $user_nicename Optional. user_nicename of user being checked. 292 * @param string $user_login Optional. user_login of user being checked. 296 * @param int $user_id User ID to check. 297 * @param string|bool $user_nicename Optional. user_nicename of user being checked. 298 * @param string|bool $user_login Optional. user_login of user being checked. 299 * 293 300 * @return string|bool The username of the matched user, or false. 294 301 */ … … 374 381 * 375 382 * @param int $user_id User ID to check. 383 * 376 384 * @return string|bool The username of the matched user, or false. 377 385 */ … … 431 439 * 432 440 * @param int $uid User ID to check. 441 * 433 442 * @return string The email for the matched user. Empty string if no user 434 * matched the $uid.443 * matched the $uid. 435 444 */ 436 445 function bp_core_get_user_email( $uid ) { … … 468 477 * Optional parameters will return just the name or just the URL. 469 478 * 470 * @param int $user_idUser ID to check.479 * @param int $user_id User ID to check. 471 480 * @param bool $no_anchor Disable URL and HTML and just return full name. 472 * Default: false.481 * Default: false. 473 482 * @param bool $just_link Disable full name and HTML and just return the URL 474 * text. Default false. 483 * text. Default false. 484 * 475 485 * @return string|bool The link text based on passed parameters, or false on 476 * no match.486 * no match. 477 487 */ 478 488 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) { … … 515 525 * 516 526 * @param array $user_ids 527 * 528 * @return array 517 529 */ 518 530 function bp_core_get_user_displaynames( $user_ids ) { … … 593 605 * 594 606 * @param int|string $user_id_or_username User ID or username. 607 * 595 608 * @return string|bool The display name for the user in question, or false if 596 * user not found.609 * user not found. 597 610 */ 598 611 function bp_core_get_user_displayname( $user_id_or_username ) { … … 638 651 * 639 652 * @param string $email The email address for the user. 653 * 640 654 * @return string The link to the users home base. False on no match. 641 655 */ … … 657 671 * 658 672 * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, 659 * this should be user_login, otherwise it should be user_nicename. 673 * this should be user_login, otherwise it should 674 * be user_nicename. 675 * 660 676 * @return string|bool The link to the user's domain, false on no match. 661 677 */ … … 708 724 709 725 /** 710 * Return the total number of members, limited to those members with last_activity 711 * 712 * @return int The number of active members 726 * Return the total number of members, limited to those members with last_activity. 727 * 728 * @return int The number of active members. 713 729 */ 714 730 function bp_core_get_active_member_count() { … … 754 770 * @since BuddyPress (1.6.0) 755 771 * 756 * @param int $user_id The ID of the user being spammed/hammed. 757 * @param string $status 'spam' if being marked as spam, 'ham' otherwise. 758 * @param bool $do_wp_cleanup True to force the cleanup of WordPress content 759 * and status, otherwise false. Generally, this should only be false if 760 * WordPress is expected to have performed this cleanup independently, 761 * as when hooked to 'make_spam_user'. 772 * @param int $user_id The ID of the user being spammed/hammed. 773 * @param string $status 'spam' if being marked as spam, 'ham' otherwise. 774 * @param bool $do_wp_cleanup True to force the cleanup of WordPress content 775 * and status, otherwise false. Generally, this should 776 * only be false if WordPress is expected to have 777 * performed this cleanup independently, as when hooked 778 * to 'make_spam_user'. 779 * 762 780 * @return bool True on success, false on failure. 763 781 */ … … 884 902 return true; 885 903 } 886 887 904 /** 888 905 * Hook to WP's make_spam_user and run our custom BP spam functions. … … 913 930 * 914 931 * @param int $user_id The ID for the user. 932 * 915 933 * @return bool True if spammer, otherwise false. 916 934 */ … … 977 995 * 978 996 * @param int $user_id The ID for the user. 997 * 979 998 * @return bool True if deleted, otherwise false. 980 999 */ … … 1048 1067 * 1049 1068 * @param int $user_id The user ID to check. 1069 * 1050 1070 * @return bool True if active, otherwise false. 1051 1071 */ … … 1084 1104 * bp_is_user_active(). 1085 1105 * 1086 * @uses is_user_logged_in() To check if user is logged in 1087 * @uses bp_get_displayed_user_id() To get current user ID 1088 * @uses bp_is_user_active() To check if user is active 1106 * @uses is_user_logged_in() To check if user is logged in. 1107 * @uses bp_get_displayed_user_id() To get current user ID. 1108 * @uses bp_is_user_active() To check if user is active. 1089 1109 * 1090 1110 * @param int $user_id The user ID to check. 1111 * 1091 1112 * @return bool True if inactive, otherwise false. 1092 1113 */ … … 1112 1133 * @since BuddyPress (1.9.0) 1113 1134 * 1114 * @param int $user_id ID of the user being updated. 1115 * @param string $time Time of last activity, in 'Y-m-d H:i:s' format. 1135 * @param int $user_id ID of the user being updated. 1136 * @param string $time Time of last activity, in 'Y-m-d H:i:s' format. 1137 * 1116 1138 * @return bool True on success, false on failure. 1117 1139 */ … … 1157 1179 * @access private For internal use only. 1158 1180 * 1159 * @param null $retval 1160 * @param int $object_id ID of the user. 1161 * @param string $meta_key Meta key being fetched. 1181 * @param null $retval 1182 * @param int $object_id ID of the user. 1183 * @param string $meta_key Meta key being fetched. 1184 * 1185 * @return mixed 1162 1186 */ 1163 1187 function _bp_get_user_meta_last_activity_warning( $retval, $object_id, $meta_key ) { … … 1190 1214 * @access private For internal use only. 1191 1215 * 1192 * @param int $meta_idID of the just-set usermeta row.1193 * @param int $object_idID of the user.1194 * @param string $meta_key Meta key being fetched.1216 * @param int $meta_id ID of the just-set usermeta row. 1217 * @param int $object_id ID of the user. 1218 * @param string $meta_key Meta key being fetched. 1195 1219 * @param string $meta_value Active time. 1196 1220 */ … … 1207 1231 * 1208 1232 * @param int $user_id The ID of the user. 1233 * 1209 1234 * @return string Time of last activity, in 'Y-m-d H:i:s' format, or an empty 1210 * string if none is found.1235 * string if none is found. 1211 1236 */ 1212 1237 function bp_get_user_last_activity( $user_id = 0 ) { … … 1266 1291 * 1267 1292 * @param int $user_id ID of the user being queried. 1293 * 1268 1294 * @return array Post IDs. 1269 1295 */ … … 1284 1310 * 1285 1311 * @param int $user_id Optional. ID of the user to be deleted. Default: the 1286 * logged-in user.1312 * logged-in user. 1287 1313 * @return bool True on success, false on failure. 1288 1314 */ … … 1353 1379 * 1354 1380 * @param int $user_id ID of the user who is about to be deleted. 1381 * 1355 1382 * @return bool True on success, false on failure. 1356 1383 */ … … 1370 1397 * 1371 1398 * @param string $str String to be upper-cased. 1399 * 1372 1400 * @return string 1373 1401 */ … … 1390 1418 * 1391 1419 * @param WP_User|WP_Error $user Either the WP_User object or the WP_Error 1392 * object, as passed to the 'authenticate' filter. 1420 * object, as passed to the 'authenticate' filter. 1421 * 1393 1422 * @return WP_User|WP_Error If the user is not a spammer, return the WP_User 1394 * object. Otherwise a new WP_Error object.1423 * object. Otherwise a new WP_Error object. 1395 1424 */ 1396 1425 function bp_core_boot_spammer( $user ) { … … 1463 1492 * Add BuddyPress-specific items to the illegal_names array. 1464 1493 * 1465 * @param array|string $value Illegal names as being saved defined in1466 * Multisite settings.1494 * @param array|string $value Illegal names as being saved defined in 1495 * Multisite settings. 1467 1496 * @param array|string $oldvalue The old value of the option. 1497 * 1468 1498 * @return array Merged and unique array of illegal names. 1469 1499 */ … … 1555 1585 * @since BuddyPress (1.6.2) 1556 1586 * 1557 * @param string $user_email The email being checked 1587 * @param string $user_email The email being checked. 1588 * 1558 1589 * @return bool|array True if the address passes all checks; otherwise an array 1559 * of error codes.1590 * of error codes. 1560 1591 */ 1561 1592 function bp_core_validate_email_address( $user_email ) { … … 1606 1637 * @see bp_core_validate_email_address() 1607 1638 * 1608 * @param WP_Error $errors WP_Error object.1609 * @param array $validation_results The return value of a validation function1610 * like bp_core_validate_email_address().1639 * @param WP_Error $errors WP_Error object. 1640 * @param array $validation_results The return value of a validation function 1641 * like bp_core_validate_email_address(). 1611 1642 */ 1612 1643 function bp_core_add_validation_error_messages( WP_Error $errors, $validation_results ) { … … 1631 1662 * Validate a user name and email address when creating a new user. 1632 1663 * 1633 * @param string $user_name Username to validate.1664 * @param string $user_name Username to validate. 1634 1665 * @param string $user_email Email address to validate. 1666 * 1635 1667 * @return array Results of user validation including errors, if any. 1636 1668 */ … … 1736 1768 * @todo Why do we have this wrapper? 1737 1769 * 1738 * @param string $blog_url Blog URL requested during registration.1770 * @param string $blog_url Blog URL requested during registration. 1739 1771 * @param string $blog_title Blog title requested during registration. 1772 * 1740 1773 * @return array 1741 1774 */ … … 1760 1793 * @todo There appears to be a bug in the return value on success. 1761 1794 * 1762 * @param string $user_login Login name requested by the user.1795 * @param string $user_login Login name requested by the user. 1763 1796 * @param string $user_password Password requested by the user. 1764 * @param string $user_email Email address entered by the user. 1765 * @param array $usermeta Miscellaneous metadata about the user (blog-specific 1766 * signup data, xprofile data, etc). 1797 * @param string $user_email Email address entered by the user. 1798 * @param array $usermeta Miscellaneous metadata about the user (blog-specific 1799 * signup data, xprofile data, etc). 1800 * 1767 1801 * @return bool|WP_Error True on success, WP_Error on failure. 1768 1802 */ … … 1856 1890 * 1857 1891 * @param string $blog_domain Domain requested by user. 1858 * @param string $blog_path Path requested by user. 1859 * @param string $blog_title Title as entered by user. 1860 * @param string $user_name user_login of requesting user. 1861 * @param string $user_email Email address of requesting user. 1862 * @param string $usermeta Miscellaneous metadata for the user. 1892 * @param string $blog_path Path requested by user. 1893 * @param string $blog_title Title as entered by user. 1894 * @param string $user_name user_login of requesting user. 1895 * @param string $user_email Email address of requesting user. 1896 * @param string $usermeta Miscellaneous metadata for the user. 1897 * 1898 * @return bool 1863 1899 */ 1864 1900 function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) { … … 1884 1920 * 1885 1921 * @param string $key Activation key. 1922 * 1886 1923 * @return int|bool User ID on success, false on failure. 1887 1924 */ … … 2125 2162 * 2126 2163 * @param int $user_id ID of the user. 2164 * 2165 * @return bool 2127 2166 */ 2128 2167 function bp_core_map_user_registration( $user_id ) { … … 2187 2226 * Send activation email to a newly registered user. 2188 2227 * 2189 * @param int $user_idID of the new user.2228 * @param int $user_id ID of the new user. 2190 2229 * @param string $user_email Email address of the new user. 2191 * @param string $key Activation key.2230 * @param string $key Activation key. 2192 2231 */ 2193 2232 function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) { … … 2248 2287 * Display a "resend email" link when an unregistered user attempts to log in. 2249 2288 * 2250 * @param WP_User|WP_Error $user Either the WP_User or the WP_Error object 2251 * @param string $username The inputted, attempted username. 2252 * @param string $password The inputted, attempted password. 2289 * @since BuddyPress (1.2.2) 2290 * 2291 * @param WP_User|WP_Error $user Either the WP_User or the WP_Error object. 2292 * @param string $username The inputted, attempted username. 2293 * @param string $password The inputted, attempted password. 2294 * 2253 2295 * @return WP_User|WP_Error 2254 *2255 * @since BuddyPress (1.2.2)2256 2296 */ 2257 2297 function bp_core_signup_disable_inactive( $user = null, $username = '', $password ='' ) { … … 2526 2566 * @since BuddyPress (2.2.0) 2527 2567 * 2528 * @param string $member_type The name of the member type. 2568 * @param string $member_type The name of the member type. 2569 * 2529 2570 * @return object A member type object. 2530 2571 */ … … 2553 2594 * element from the array needs to match; 'and' means all elements 2554 2595 * must match. Accepts 'or' or 'and'. Default 'and'. 2596 * 2555 2597 * @return array A list of member type names or objects. 2556 2598 */ … … 2660 2702 * @since BuddyPress (2.2.0) 2661 2703 * 2662 * @param int $user_id ID of the user. 2663 * @param bool $single Optional. Whether to return a single type string. If multiple types are found 2664 * for the user, the oldest one will be returned. Default: true. 2704 * @param int $user_id ID of the user. 2705 * @param bool $single Optional. Whether to return a single type string. If multiple types are found 2706 * for the user, the oldest one will be returned. Default: true. 2707 * 2665 2708 * @return string|array|bool On success, returns a single member type (if $single is true) or an array of member 2666 2709 * types (if $single is false). Returns false on failure. … … 2704 2747 * @since BuddyPress (2.3.0) 2705 2748 * 2706 * @param int $user_id $user_id ID of the user. 2707 * @param string $member_type Member Type. 2749 * @param int $user_id $user_id ID of the user. 2750 * @param string $member_type Member Type. 2751 * 2708 2752 * @return bool Whether the user has the given member type. 2709 2753 */ … … 2729 2773 * @since BuddyPress (2.2.0) 2730 2774 * 2731 * @param int $user_id ID of the user. 2775 * @param int $user_id ID of the user. 2776 * 2732 2777 * @return See {@see bp_set_member_type()}. 2733 2778 */
Note: See TracChangeset
for help on using the changeset viewer.