Changeset 14071 for trunk/src/bp-members/classes/class-bp-signup.php
- Timestamp:
- 11/03/2024 06:44:17 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-members/classes/class-bp-signup.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-signup.php
r13989 r14071 4 4 * 5 5 * @package BuddyPress 6 * @subpackage coreClasses6 * @subpackage Signup 7 7 * @since 2.0.0 8 8 */ … … 160 160 * @since 2.0.0 161 161 * 162 * @param int eger$signup_id The ID for the signup being queried.162 * @param int $signup_id The ID for the signup being queried. 163 163 */ 164 164 public function __construct( $signup_id = 0 ) { … … 249 249 * was sent in the last day. 250 250 */ 251 $this->recently_sent = $this->count_sent && ( $diff < 1 * DAY_IN_SECONDS ); 252 251 $this->recently_sent = $this->count_sent && ( $diff < DAY_IN_SECONDS ); 253 252 } 254 253 … … 827 826 * 828 827 * @since 2.0.0 829 * 830 * @param array $signup_ids Single ID or list of IDs to resend. 828 * @since 15.0.0 Added the ability to resend to a single ID. 829 * 830 * @param array|int $signup_ids Single ID or list of IDs to resend. 831 831 * @return array 832 832 */ 833 833 public static function resend( $signup_ids = array() ) { 834 if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) { 835 return false; 834 if ( empty( $signup_ids ) ) { 835 return array(); 836 } 837 838 if ( ! is_array( $signup_ids ) ) { 839 $signup_ids = array( $signup_ids ); 836 840 } 837 841 838 842 $to_resend = self::get( 839 843 array( 840 'include' => $signup_ids,844 'include' => wp_parse_id_list( $signup_ids ), 841 845 ) 842 846 ); 843 847 844 if ( ! $signups = $to_resend['signups'] ) { 845 return false; 848 $signups = $to_resend['signups']; 849 850 if ( ! $signups ) { 851 return array(); 846 852 } 847 853 … … 876 882 $user_id = email_exists( $signup->user_email ); 877 883 878 if ( ! empty( $user_id ) && 2 != self::check_user_status( $user_id ) ) {884 if ( ! empty( $user_id ) && 2 !== self::check_user_status( $user_id ) ) { 879 885 880 886 // Status is not 2, so user's account has been activated. … … 886 892 continue; 887 893 888 // Send the validation email.894 // Send the validation email. 889 895 } else { 890 896 $salutation = $signup->user_login; … … 907 913 908 914 /** 909 * Fires after activation email s areresent.915 * Fires after activation email(s) are/is resent. 910 916 * 911 917 * @since 2.0.0 … … 924 930 */ 925 931 return apply_filters( 'bp_core_signup_resend', $result ); 932 } 933 934 /** 935 * Check if an activation email can be resent. 936 * 937 * @since 15.0.0 938 * 939 * @param BP_Signup $signup The signup object. 940 * @return bool 941 */ 942 public static function allow_activation_resend( $signup ) { 943 944 // Bail if the signup is not a BP_Signup object. 945 if ( ! $signup instanceof BP_Signup ) { 946 return false; 947 } 948 949 // Allow the activation email to be sent if not already. 950 if ( ! $signup->recently_sent || ! $signup->count_sent ) { 951 return true; 952 } 953 954 $sent_at = mysql2date( 'U', $signup->date_sent ); 955 $now = time(); 956 $diff = $now - $sent_at; 957 958 /** 959 * Filters the lock time for the resend activation. 960 * 961 * @since 15.0.0 962 * 963 * @param float|int $lock_time The lock time for the resend activation. Default: 1 hour. 964 * @param BP_Signup $signup The signup object. 965 */ 966 $lock_time = apply_filters( 'bp_core_signup_resend_activation_lock_time', HOUR_IN_SECONDS, $signup ); 967 968 // If the activation email was sent less than the lock time ago. 969 return false === ( $diff < $lock_time ); 926 970 } 927 971
Note: See TracChangeset
for help on using the changeset viewer.