Changeset 8318
- Timestamp:
- 04/24/2014 09:59:12 PM (11 years ago)
- Location:
- trunk/bp-members
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-actions.php
r7562 r8318 16 16 17 17 /** 18 * Catch a "Mark as Spammer/Not Spammer" click from the toolbar. 19 * 18 20 * When a site admin selects "Mark as Spammer/Not Spammer" from the admin menu 19 21 * this action will fire and mark or unmark the user and their blogs as spam. 20 22 * Must be a site admin for this function to run. 21 23 * 22 * @package BuddyPress Core 23 * @param int $user_id Optional user ID to mark as spam 24 * @global object $wpdb Global WordPress Database object 24 * Note: no longer used in the current state. See the Settings component. 25 * 26 * @param int $user_id Optional. User ID to mark as spam. Defaults to displayed 27 * user. 25 28 */ 26 29 function bp_core_action_set_spammer_status( $user_id = 0 ) { … … 66 69 67 70 /** 68 * Allows a site admin to delete a user from the adminbar menu.71 * Process user deletion requests. 69 72 * 70 * @package BuddyPress Core73 * Note: No longer called here. See the Settings component. 71 74 */ 72 75 function bp_core_action_delete_user() { … … 102 105 103 106 /** 104 * Re turns the user_id for a user based on their username.107 * Redirect to a random member page when visiting a ?random-member URL. 105 108 * 106 * @package BuddyPress Core107 * @param string $username Username to check.108 109 * @since BuddyPress (1.0) 109 110 */ -
trunk/bp-members/bp-members-admin.php
r8304 r8318 62 62 * @since BuddyPress (2.0.0) 63 63 * 64 * @uses buddypress() to get BuddyPress main instance 64 * @uses buddypress() to get BuddyPress main instance. 65 65 */ 66 66 public static function register_members_admin() { -
trunk/bp-members/bp-members-adminbar.php
r7859 r8318 4 4 * BuddyPress Members Toolbar 5 5 * 6 * Handles the member functions related to the WordPress Toolbar 6 * Handles the member functions related to the WordPress Toolbar. 7 7 * 8 8 * @package BuddyPress … … 16 16 * Add the "My Account" menu and all submenus. 17 17 * 18 * @since BuddyPress (1.6) 18 * @since BuddyPress (1.6.0) 19 * 19 20 * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support 20 21 */ … … 67 68 68 69 /** 69 * Add s the User Admin top-level menu to user pages70 * Add the User Admin top-level menu to user pages. 70 71 * 71 * @package BuddyPress 72 * @since BuddyPress (1.5) 72 * @since BuddyPress (1.5.0) 73 73 */ 74 74 function bp_members_admin_bar_user_admin_menu() { … … 137 137 138 138 /** 139 * Build the "Notifications" dropdown 139 * Build the "Notifications" dropdown. 140 140 * 141 * @package BuddyPress 142 * @since BuddyPress (1.5) 141 * @since BuddyPress (1.5.0) 143 142 */ 144 143 function bp_members_admin_bar_notifications_menu() { … … 154 153 155 154 /** 156 * Remove rogue WP core edit menu when viewing a single user155 * Remove rogue WP core Edit menu when viewing a single user. 157 156 * 158 * @since BuddyPress (1.6 )157 * @since BuddyPress (1.6.0) 159 158 */ 160 159 function bp_members_remove_edit_page_menu() { -
trunk/bp-members/bp-members-buddybar.php
r7521 r8318 4 4 * BuddyPress Members BuddyBar 5 5 * 6 * Handles the member functions related to the BuddyBar 6 * Handles the member functions related to the BuddyBar. 7 7 * 8 8 * @package BuddyPress … … 14 14 15 15 /** 16 * Notifications Menu16 * Add the Notifications menu to the BuddyBar. 17 17 */ 18 18 function bp_adminbar_notifications_menu() { … … 28 28 29 29 /** 30 * Blog Authors Menu (visible when not logged in)30 * Add the Blog Authors menu to the BuddyBar (visible when not logged in). 31 31 */ 32 32 function bp_adminbar_authors_menu() { … … 75 75 76 76 /** 77 * Add a member admin menu to the BuddyBar. 78 * 77 79 * Adds an Toolbar menu to any profile page providing site moderator actions 78 80 * that allow capable users to clean up a users account. 79 *80 * @package BuddyPress XProfile81 81 */ 82 82 function bp_members_adminbar_admin_menu() { -
trunk/bp-members/bp-members-classes.php
r8294 r8318 473 473 * @since BuddyPress (2.0.0) 474 474 * 475 * @param array $signup_ids single id or list of ids to resend476 * @return array the results475 * @param array $signup_ids Single ID or list of IDs to resend. 476 * @return array 477 477 */ 478 478 public static function resend( $signup_ids = array() ) { … … 540 540 * @since BuddyPress (2.0.0) 541 541 * 542 * @param array $signup_ids Single id or list of ids to resend.543 * @return array the results542 * @param array $signup_ids Single ID or list of IDs to activate. 543 * @return array 544 544 */ 545 545 public static function activate( $signup_ids = array() ) { … … 600 600 * @since BuddyPress (2.0.0) 601 601 * 602 * @param array $signup_ids single id or list of ids to resend603 * @return array the results602 * @param array $signup_ids Single ID or list of IDs to delete. 603 * @return array 604 604 */ 605 605 public static function delete( $signup_ids = array() ) { -
trunk/bp-members/bp-members-filters.php
r6486 r8318 4 4 * BuddyPress Members Filters 5 5 * 6 * Member specific filters6 * Filters specific to the Members component. 7 7 * 8 8 * @package BuddyPress … … 14 14 15 15 /** 16 * Escape commonly used fullname output functions 16 * Escape commonly used fullname output functions. 17 17 */ 18 18 add_filter( 'bp_displayed_user_fullname', 'esc_html' ); … … 20 20 21 21 /** 22 * Load additional sign-up sanitization filters on bp_loaded. These are used 23 * to prevent XSS in the BuddyPress sign-up process. You can unhook these to 24 * allow for customization of your registration fields, however it is highly 25 * recommended that you leave these in place for the safety of your network. 22 * Load additional sign-up sanitization filters on bp_loaded. 26 23 * 27 * @since BuddyPress (1.5) 28 * @uses add_filter() 24 * These are used to prevent XSS in the BuddyPress sign-up process. You can 25 * unhook these to allow for customization of your registration fields; 26 * however, it is highly recommended that you leave these in place for the 27 * safety of your network. 28 * 29 * @since BuddyPress (1.5.0) 29 30 */ 30 31 function bp_members_signup_sanitization() { … … 54 55 55 56 /** 56 * Filter the user profile URL to point to BuddyPress profile edit 57 * Filter the user profile URL to point to BuddyPress profile edit. 57 58 * 58 * @since BuddyPress 1.659 * @since BuddyPress (1.6.0) 59 60 * 60 * @param string $url 61 * @param int $user_id 61 * @param string $url WP profile edit URL. 62 * @param int $user_id ID of the user. 62 63 * @param string $scheme 63 64 * @return string -
trunk/bp-members/bp-members-functions.php
r8315 r8318 14 14 15 15 /** 16 * Checks $bp pages global and looks for directory page 17 * 18 * @since BuddyPress (1.5) 19 * 20 * @global BuddyPress $bp The one true BuddyPress instance 21 * @return bool True if set, False if empty 16 * Check for the existence of a Members directory page. 17 * 18 * @since BuddyPress (1.5.0) 19 * 20 * @return bool True if found, otherwise false. 22 21 */ 23 22 function bp_members_has_directory() { … … 28 27 29 28 /** 30 * Define the slugs used for BuddyPress pages, based on the slugs of the WP pages used. 31 * These can be overridden manually by defining these slugs in wp-config.php. 32 * 33 * The fallback values are only used during initial BP page creation, when no slugs have been 34 * explicitly defined. 35 * 36 * @package BuddyPress Core Core 37 * @global BuddyPress $bp The one true BuddyPress instance 29 * Define the slug constants for the Members component. 30 * 31 * Handles the three slug constants used in the Members component - 32 * BP_MEMBERS_SLUG, BP_REGISTER_SLUG, and BP_ACTIVATION_SLUG. If these 33 * constants are not overridden in wp-config.php or bp-custom.php, they are 34 * defined here to match the slug of the corresponding WP pages. 35 * 36 * In general, fallback values are only used during initial BP page creation, 37 * when no slugs have been explicitly defined. 38 * 39 * @global BuddyPress $bp The one true BuddyPress instance. 38 40 */ 39 41 function bp_core_define_slugs() { … … 70 72 71 73 /** 72 * Return an array of users IDs based on the parameters passed.74 * Fetch an array of users based on the parameters passed. 73 75 * 74 76 * Since BuddyPress 1.7, bp_core_get_users() uses BP_User_Query. If you … … 76 78 * bp_use_legacy_user_query value, returning true. 77 79 * 78 * @package BuddyPress Core 80 * @param array $args { 81 * Array of arguments. All are optional. See {@link BP_User_Query} for 82 * a more complete description of arguments. 83 * @type string $type Sort order. Default: 'active'. 84 * @type int $user_id Limit results to friends of a user. Default: false. 85 * @type mixed $exclude IDs to exclude from results. Default: false. 86 * @type string $search_terms Limit to users matching search terms. Default: false. 87 * @type string $meta_key Limit to users with a meta_key. Default: false. 88 * @type string $meta_value Limit to users with a meta_value (with 89 * meta_key). Default: false. 90 * @type mixed $include Limit results by user IDs. Default: false. 91 * @type int $per_page Results per page. Default: 20. 92 * @type int $page Page of results. Default: 1. 93 * @type bool $populate_extras Fetch optional extras. Default: true. 94 * @type string|bool $count_total How to do total user count. 95 * Default: 'count_query'. 96 * } 97 * @return array 79 98 */ 80 99 function bp_core_get_users( $args = '' ) { … … 117 136 118 137 /** 119 * Returns the domain for the passed user: e.g. http://domain.com/members/andy/ 120 * 121 * @package BuddyPress Core 122 * @global $current_user WordPress global variable containing current logged in user information 138 * Return the domain for the passed user: e.g. http://domain.com/members/andy/. 139 * 123 140 * @param int $user_id The ID of the user. 141 * @param string $user_nicename Optional. user_nicename of the user. 142 * @param string $user_login Optional. user_login of the user. 124 143 */ 125 144 function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) { … … 148 167 * Fetch everything in the wp_users table for a user, without any usermeta. 149 168 * 150 * @package BuddyPress Core151 169 * @param int $user_id The ID of the user. 152 * @ uses BP_Core_User::get_core_userdata() Performs the query.170 * @return array 153 171 */ 154 172 function bp_core_get_core_userdata( $user_id ) { … … 164 182 165 183 /** 166 * Returns the user id for the user that is currently being displayed. 167 * eg: http://andy.domain.com/ or http://domain.com/andy/ 168 * 169 * @package BuddyPress Core 170 * @uses bp_core_get_userid_from_user_login() Returns the user id for the username passed 171 * @return int The user id for the user that is currently being displayed, return zero if this is not a user home and just a normal blog. 184 * Return the ID of a user, based on user_login. 185 * 186 * No longer used. 187 * 188 * @todo Deprecate. 189 * 190 * @param string $user_login user_login of the user being queried. 191 * @return int 172 192 */ 173 193 function bp_core_get_displayed_userid( $user_login ) { … … 176 196 177 197 /** 178 * Returns the user_id for a user based on their username. 179 * 180 * @package BuddyPress Core 198 * Return the user_id for a user based on their user_login. 199 * 200 * @todo Refactor to check relevant WP caches, or to use get_user_by() 201 * 181 202 * @param string $username Username to check. 182 * @global $wpdb WordPress DB access object.183 203 * @return int|bool The ID of the matched user, or false. 184 204 */ … … 195 215 * Returns the user_id for a user based on their user_nicename. 196 216 * 197 * @package BuddyPress Core 217 * @todo Refactor to check relevant WP caches, or to use get_user_by() 218 * 198 219 * @param string $username Username to check. 199 * @global $wpdb WordPress DB access object.200 220 * @return int|bool The ID of the matched user, or false. 201 221 */ … … 210 230 211 231 /** 212 * Returns the username for a user based on their user id. 213 * 214 * @package BuddyPress Core 215 * @param int $uid User ID to check. 216 * @uses bp_core_get_core_userdata() Fetch the userdata for a user ID 232 * Return the username for a user based on their user id. 233 * 234 * This function is sensitive to the BP_ENABLE_USERNAME_COMPATIBILITY_MODE, 235 * so it will return the user_login or user_nicename as appropriate. 236 * 237 * @param int $user_id User ID to check. 238 * @param string $user_nicename Optional. user_nicename of user being checked. 239 * @param string $user_login Optional. user_login of user being checked. 217 240 * @return string|bool The username of the matched user, or false. 218 241 */ … … 281 304 282 305 /** 283 * Return s the user_nicename for a user based on their user_id. This should be284 * used for linking to user profiles and anywhere else a sanitized and unique285 * slug to a user is needed.286 * 287 * @since BuddyPress (1.5)288 * 289 * @package BuddyPress Core290 * @ param int $uid User ID to check.291 * @global $userdata WordPress user data for the current logged in user.292 * @ uses get_userdata() WordPress function to fetch the userdata for a user ID306 * Return the user_nicename for a user based on their user_id. 307 * 308 * This should be used for linking to user profiles and anywhere else a 309 * sanitized and unique slug to a user is needed. 310 * 311 * @since BuddyPress (1.5.0) 312 * 313 * @todo Refactor to use a WP core function, if possible. 314 * 315 * @param int $user_id User ID to check. 293 316 * @return string|bool The username of the matched user, or false. 294 317 */ … … 337 360 338 361 /** 339 * Returns the email address for the user based on user ID 340 * 341 * @package BuddyPress Core 362 * Return the email address for the user based on user ID. 363 * 342 364 * @param int $uid User ID to check. 343 * @ uses get_userdata() WordPress function to fetch the userdata for a user ID344 * @return string The email for the matched user. Empty string if no usermatched the $uid.365 * @return string The email for the matched user. Empty string if no user 366 * matched the $uid. 345 367 */ 346 368 function bp_core_get_user_email( $uid ) { … … 362 384 363 385 /** 364 * Returns a HTML formatted link for a user with the user's full name as the link text. 386 * Return a HTML formatted link for a user with the user's full name as the link text. 387 * 365 388 * eg: <a href="http://andy.domain.com/">Andy Peatling</a> 389 * 366 390 * Optional parameters will return just the name or just the URL. 367 391 * 368 392 * @param int $user_id User ID to check. 369 * @param bool $no_anchor Disable URL and HTML and just return full name. Default false. 370 * @param bool $just_link Disable full name and HTML and just return the URL text. Default false. 371 * @return string|bool The link text based on passed parameters, or false on no match. 372 * @todo This function needs to be cleaned up or split into separate functions 393 * @param bool $no_anchor Disable URL and HTML and just return full name. 394 * Default: false. 395 * @param bool $just_link Disable full name and HTML and just return the URL 396 * text. Default false. 397 * @return string|bool The link text based on passed parameters, or false on 398 * no match. 373 399 */ 374 400 function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false ) { … … 515 541 516 542 /** 517 * Returns the user link for the user based on user email address 518 * 519 * @package BuddyPress Core 543 * Return the user link for the user based on user email address. 544 * 520 545 * @param string $email The email address for the user. 521 * @uses bp_core_get_userlink() BuddyPress function to get a userlink by user ID.522 * @uses get_user_by() WordPress function to get userdata via an email address523 546 * @return string The link to the users home base. False on no match. 524 547 */ … … 529 552 530 553 /** 531 * Returns the user link for the user based on the supplied identifier 532 * 533 * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, this will be user_login, otherwise it will be user_nicename. 534 * @return string|bool The link to the users home base, false on no match. 554 * Return the user link for the user based on the supplied identifier. 555 * 556 * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, 557 * this should be user_login, otherwise it should be user_nicename. 558 * @return string|bool The link to the user's domain, false on no match. 535 559 */ 536 560 function bp_core_get_userlink_by_username( $username ) { … … 544 568 545 569 /** 546 * Returns the total number of members for the installation. 547 * 548 * @package BuddyPress Core 570 * Return the total number of members for the installation. 571 * 572 * Note that this is a raw count of non-spam, activated users. It does not 573 * account for users who have logged activity (last_active). See 574 * {@link bp_core_get_active_member_count()}. 575 * 549 576 * @return int The total number of members. 550 577 */ … … 562 589 563 590 /** 564 * Return sthe total number of members, limited to those members with last_activity591 * Return the total number of members, limited to those members with last_activity 565 592 * 566 593 * @return int The number of active members … … 688 715 689 716 /** 690 * Hook to WP's make_spam_user and run our custom BP spam functions 691 * 692 * @since BuddyPress (1.6 )693 * 694 * @param int $user_id The user id passed from the make_spam_user hook717 * Hook to WP's make_spam_user and run our custom BP spam functions. 718 * 719 * @since BuddyPress (1.6.0) 720 * 721 * @param int $user_id The user ID passed from the make_spam_user hook. 695 722 */ 696 723 function bp_core_mark_user_spam_admin( $user_id ) { … … 700 727 701 728 /** 702 * Hook to WP's make_ham_user and run our custom BP spam functions 703 * 704 * @since BuddyPress (1.6 )705 * 706 * @param int $user_id The user id passed from the make_ham_user hook729 * Hook to WP's make_ham_user and run our custom BP spam functions. 730 * 731 * @since BuddyPress (1.6.0) 732 * 733 * @param int $user_id The user ID passed from the make_ham_user hook. 707 734 */ 708 735 function bp_core_mark_user_ham_admin( $user_id ) { … … 712 739 713 740 /** 714 * Checks if the user has been marked as a spammer. 715 * 716 * @package BuddyPress Core 717 * @param int $user_id int The id for the user. 718 * @return bool True if spammer, False if not. 741 * Check whether a user has been marked as a spammer. 742 * 743 * @param int $user_id The ID for the user. 744 * @return bool True if spammer, otherwise false. 719 745 */ 720 746 function bp_is_user_spammer( $user_id = 0 ) { … … 767 793 768 794 /** 769 * Checks if the user has been marked as deleted. 770 * 771 * @package BuddyPress Core 772 * @param int $user_id int The id for the user. 773 * @return bool True if deleted, False if not. 795 * Check whether a user has been marked as deleted. 796 * 797 * @param int $user_id The ID for the user. 798 * @return bool True if deleted, otherwise false. 774 799 */ 775 800 function bp_is_user_deleted( $user_id = 0 ) { … … 823 848 824 849 /** 825 * Check s if user is active826 * 827 * @since BuddyPress (1.6 )850 * Check whether a user is "active", ie neither deleted nor spammer. 851 * 852 * @since BuddyPress (1.6.0) 828 853 * 829 854 * @uses is_user_logged_in() To check if user is logged in … … 832 857 * @uses bp_is_user_deleted() To check if user is deleted 833 858 * 834 * @param int $user_id The user ID to check 835 * @return bool True if public, false if not859 * @param int $user_id The user ID to check. 860 * @return bool True if active, otherwise false. 836 861 */ 837 862 function bp_is_user_active( $user_id = 0 ) { … … 858 883 859 884 /** 860 * Checks if user is not active. 861 * 862 * @since BuddyPress (1.6) 885 * Check whether user is not active. 886 * 887 * @since BuddyPress (1.6.0) 888 * 889 * @todo No need for the user fallback checks, since they're done in 890 * bp_is_user_active(). 863 891 * 864 892 * @uses is_user_logged_in() To check if user is logged in … … 866 894 * @uses bp_is_user_active() To check if user is active 867 895 * 868 * @param int $user_id The user ID to check 869 * @return bool True if inactive, false if active896 * @param int $user_id The user ID to check. 897 * @return bool True if inactive, otherwise false. 870 898 */ 871 899 function bp_is_user_inactive( $user_id = 0 ) { … … 1029 1057 * Fetch every post that is authored by the given user for the current blog. 1030 1058 * 1031 * @package BuddyPress Core 1032 * @global $wpdb WordPress user data for the current logged in user. 1033 * @return array of post ids. 1059 * No longer used in BuddyPress. 1060 * 1061 * @todo Deprecate. 1062 * 1063 * @param int $user_id ID of the user being queried. 1064 * @return array Post IDs. 1034 1065 */ 1035 1066 function bp_core_get_all_posts_for_user( $user_id = 0 ) { … … 1043 1074 1044 1075 /** 1045 * Allows a user to completely remove their account from the system 1046 * 1047 * @package BuddyPress Core 1048 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs. 1049 * @uses wp_delete_user() Deletes a user from the system on singlesite installs. 1076 * Process account deletion requests. 1077 * 1078 * Primarily used for self-deletions, as requested through Settings. 1079 * 1080 * @param int $user_id Optional. ID of the user to be deleted. Default: the 1081 * logged-in user. 1082 * @return bool True on success, false on failure. 1050 1083 */ 1051 1084 function bp_core_delete_account( $user_id = 0 ) { … … 1115 1148 1116 1149 /** 1117 * Localization safe ucfirst() support. 1118 * 1119 * @package BuddyPress Core 1150 * Multibyte-safe ucfirst() support. 1151 * 1152 * Uses multibyte functions when available on the PHP build. 1153 * 1154 * @param string $str String to be upper-cased. 1155 * @return string 1120 1156 */ 1121 1157 function bp_core_ucfirst( $str ) { … … 1129 1165 1130 1166 /** 1131 * When a user logs in, check if they have been marked as a spammer. If yes then simply 1132 * redirect them to the home page and stop them from logging in. 1133 * 1134 * @param WP_User|WP_Error $user Either the WP_User object or the WP_Error object 1135 * @return WP_User|WP_Error If the user is not a spammer, return the WP_User object. Otherwise a new WP_Error object. 1167 * Prevent spammers from logging in. 1168 * 1169 * When a user logs in, check if they have been marked as a spammer. If yes 1170 * then simply redirect them to the home page and stop them from logging in. 1136 1171 * 1137 1172 * @since BuddyPress (1.1.2) 1173 * 1174 * @param WP_User|WP_Error $user Either the WP_User object or the WP_Error 1175 * object, as passed to the 'authenticate' filter. 1176 * @return WP_User|WP_Error If the user is not a spammer, return the WP_User 1177 * object. Otherwise a new WP_Error object. 1138 1178 */ 1139 1179 function bp_core_boot_spammer( $user ) { … … 1153 1193 1154 1194 /** 1155 * Deletes usermeta for the user when the user is deleted. 1156 * 1157 * @package BuddyPress Core 1158 * @param int $user_id The user id for the user to delete usermeta for 1159 * @uses bp_delete_user_meta() deletes a row from the wp_usermeta table based on meta_key 1195 * Delete last_activity data for the user when the user is deleted. 1196 * 1197 * @param int $user_id The user ID for the user to delete usermeta for. 1160 1198 */ 1161 1199 function bp_core_remove_data( $user_id ) { … … 1171 1209 add_action( 'bp_make_spam_user', 'bp_core_remove_data' ); 1172 1210 1211 /** 1212 * Check whether the logged-in user can edit settings for the displayed user. 1213 * 1214 * @return bool True if editing is allowed, otherwise false. 1215 */ 1173 1216 function bp_core_can_edit_settings() { 1174 1217 if ( bp_is_my_profile() ) … … 1188 1231 1189 1232 /** 1190 * Flush illegal names by getting and setting 'illegal_names' site option 1233 * Flush illegal names by getting and setting 'illegal_names' site option. 1191 1234 */ 1192 1235 function bp_core_flush_illegal_names() { … … 1196 1239 1197 1240 /** 1198 * Filter the illegal_names site option and make sure it includes a few1199 * specific BuddyPress and Multi-site slugs1200 * 1201 * @param array|string $value Illegal names from field1202 * @param array|string $oldvalue The value as it is currently1203 * @return array Merged and unique array of illegal names 1241 * Add BuddyPress-specific items to the illegal_names array. 1242 * 1243 * @param array|string $value Illegal names as being saved defined in 1244 * Multisite settings. 1245 * @param array|string $oldvalue The old value of the option. 1246 * @return array Merged and unique array of illegal names. 1204 1247 */ 1205 1248 function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) { … … 1267 1310 1268 1311 /** 1269 * Check that an email address is valid for use 1312 * Check that an email address is valid for use. 1270 1313 * 1271 1314 * Performs the following checks: … … 1279 1322 * @param string $user_email The email being checked 1280 1323 * @return bool|array True if the address passes all checks; otherwise an array 1281 * of error codes1324 * of error codes. 1282 1325 */ 1283 1326 function bp_core_validate_email_address( $user_email ) { … … 1315 1358 1316 1359 /** 1317 * Add the appropriate errors to a WP_Error object, given results of a validation test 1360 * Add the appropriate errors to a WP_Error object, given results of a validation test. 1318 1361 * 1319 1362 * Functions like bp_core_validate_email_address() return a structured array … … 1321 1364 * parses, adding the appropriate error messages to the WP_Error object. 1322 1365 * 1323 * @since BuddyPress (1.7) 1366 * @since BuddyPress (1.7.0) 1367 * 1324 1368 * @see bp_core_validate_email_address() 1325 1369 * 1326 * @param WP_Error $errors WP_Error object 1370 * @param WP_Error $errors WP_Error object. 1327 1371 * @param array $validation_results The return value of a validation function 1328 * like bp_core_validate_email_address()1372 * like bp_core_validate_email_address(). 1329 1373 */ 1330 1374 function bp_core_add_validation_error_messages( WP_Error $errors, $validation_results ) { … … 1345 1389 * Validate a user name and email address when creating a new user. 1346 1390 * 1347 * @param string $user_name Username to validate 1348 * @param string $user_email Email address to validate 1349 * @return array Results of user validation including errors, if any 1391 * @param string $user_name Username to validate. 1392 * @param string $user_email Email address to validate. 1393 * @return array Results of user validation including errors, if any. 1350 1394 */ 1351 1395 function bp_core_validate_user_signup( $user_name, $user_email ) { … … 1432 1476 } 1433 1477 1478 /** 1479 * Validate blog URL and title provided at signup. 1480 * 1481 * @todo Why do we have this wrapper? 1482 * 1483 * @param string $blog_url Blog URL requested during registration. 1484 * @param string $blog_title Blog title requested during registration. 1485 * @return array 1486 */ 1434 1487 function bp_core_validate_blog_signup( $blog_url, $blog_title ) { 1435 1488 if ( !is_multisite() || !function_exists( 'wpmu_validate_blog_signup' ) ) … … 1439 1492 } 1440 1493 1494 /** 1495 * Process data submitted at user registration and convert to a signup object. 1496 * 1497 * @todo There appears to be a bug in the return value on success. 1498 * 1499 * @param string $user_login Login name requested by the user. 1500 * @param string $user_password Password requested by the user. 1501 * @param string $user_email Email address entered by the user. 1502 * @param array $usermeta Miscellaneous metadata about the user (blog-specific 1503 * signup data, xprofile data, etc). 1504 * @return bool|WP_Error True on success, WP_Error on failure. 1505 */ 1441 1506 function bp_core_signup_user( $user_login, $user_password, $user_email, $usermeta ) { 1442 1507 global $bp; … … 1500 1565 } 1501 1566 1567 /** 1568 * Create a blog and user based on data supplied at user registration. 1569 * 1570 * @param string $blog_domain Domain requested by user. 1571 * @param string $blog_path Path requested by user. 1572 * @param string $blog_title Title as entered by user. 1573 * @param string $user_name user_login of requesting user. 1574 * @param string $user_email Email address of requesting user. 1575 * @param string $usermeta Miscellaneous metadata for the user. 1576 */ 1502 1577 function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta ) { 1503 1578 if ( !is_multisite() || !function_exists( 'wpmu_signup_blog' ) ) … … 1507 1582 } 1508 1583 1584 /** 1585 * Activate a signup, as identified by an activation key. 1586 * 1587 * @param string $key Activation key. 1588 * @return int|bool User ID on success, false on failure. 1589 */ 1509 1590 function bp_core_activate_signup( $key ) { 1510 1591 global $wpdb; … … 1719 1800 } 1720 1801 1802 /** 1803 * Create a "became a registered user" activity item when a user activates his account. 1804 * 1805 * @param array $user Array of userdata passed to bp_core_activated_user hook. 1806 */ 1721 1807 function bp_core_new_user_activity( $user ) { 1722 1808 if ( empty( $user ) || !bp_is_active( 'activity' ) ) … … 1741 1827 add_action( 'bp_core_activated_user', 'bp_core_new_user_activity' ); 1742 1828 1829 /** 1830 * Map a user's WP display name to the XProfile fullname field, if necessary. 1831 * 1832 * This only happens when a user is registered in wp-admin by an administrator; 1833 * during normal registration, XProfile data is provided directly by the user. 1834 * 1835 * @param int $user_id ID of the user. 1836 */ 1743 1837 function bp_core_map_user_registration( $user_id ) { 1744 1838 … … 1761 1855 add_action( 'user_register', 'bp_core_map_user_registration' ); 1762 1856 1857 /** 1858 * Get the avatar storage directory for use during registration. 1859 * 1860 * @return string|bool Directory path on success, false on failure. 1861 */ 1763 1862 function bp_core_signup_avatar_upload_dir() { 1764 1863 global $bp; … … 1780 1879 } 1781 1880 1881 /** 1882 * Send activation email to a newly registered user. 1883 * 1884 * @param int $user_id ID of the new user. 1885 * @param string $user_email Email address of the new user. 1886 * @param string $key Activation key. 1887 */ 1782 1888 function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) { 1783 1889 $activate_url = bp_get_activation_page() ."?key=$key"; … … 1892 1998 1893 1999 /** 1894 * Kill the wp-signup.php if custom registration signup templates are present2000 * Redirect away from wp-signup.php if BP registration templates are present. 1895 2001 */ 1896 2002 function bp_core_wpsignup_redirect() { … … 1929 2035 * This is important as the $bp->loggedin_user object is setup at priority 4. 1930 2036 * 1931 * @since BuddyPress ( v1.8)2037 * @since BuddyPress (1.8.0) 1932 2038 */ 1933 2039 function bp_stop_live_spammer() { … … 1973 2079 * Show a custom error message when a logged-in user is marked as a spammer. 1974 2080 * 1975 * @since BuddyPress ( v1.8)2081 * @since BuddyPress (1.8.0) 1976 2082 */ 1977 2083 function bp_live_spammer_login_error() {
Note: See TracChangeset
for help on using the changeset viewer.