Changeset 50230 for trunk/src/wp-includes/user.php
- Timestamp:
- 02/05/2021 03:48:59 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r50165 r50230 3937 3937 * 3938 3938 * @since 4.9.6 3939 * @since 5.7.0 Added the `$s end_confirmation_email` parameter.3939 * @since 5.7.0 Added the `$status` parameter. 3940 3940 * 3941 3941 * @param string $email_address User email address. This can be the address of a registered … … 3944 3944 * @param array $request_data Misc data you want to send with the verification request and pass 3945 3945 * to the actions once the request is confirmed. 3946 * @param bool $send_confirmation_email Optional. If false, the request status is set to 'Completed' directly. 3947 * Default true. 3946 * @param string $status Optional request status (pending or confirmed). Default 'pending'. 3948 3947 * @return int|WP_Error Returns the request ID if successful, or a WP_Error object on failure. 3949 3948 */ 3950 function wp_create_user_request( $email_address = '', $action_name = '', $request_data = array(), $s end_confirmation_email = true) {3949 function wp_create_user_request( $email_address = '', $action_name = '', $request_data = array(), $status = 'pending' ) { 3951 3950 $email_address = sanitize_email( $email_address ); 3952 3951 $action_name = sanitize_key( $action_name ); … … 3958 3957 if ( ! in_array( $action_name, _wp_privacy_action_request_types(), true ) ) { 3959 3958 return new WP_Error( 'invalid_action', __( 'Invalid action name.' ) ); 3959 } 3960 3961 if ( ! in_array( $status, array( 'pending', 'confirmed' ), true ) ) { 3962 return new WP_Error( 'invalid_status', __( 'Invalid request status.' ) ); 3960 3963 } 3961 3964 … … 3981 3984 } 3982 3985 3983 if ( false !== $send_confirmation_email ) {3984 $status = 'request-pending';3985 } else {3986 $status = 'request-completed';3987 }3988 3989 3986 $request_id = wp_insert_post( 3990 3987 array( … … 3993 3990 'post_title' => $email_address, 3994 3991 'post_content' => wp_json_encode( $request_data ), 3995 'post_status' => $status,3992 'post_status' => 'request-' . $status, 3996 3993 'post_type' => 'user_request', 3997 3994 'post_date' => current_time( 'mysql', false ),
Note: See TracChangeset
for help on using the changeset viewer.