WordPress开发者和主题制作者的搜索引擎



_wp_privacy_resend_request ›

Since4.9.6
已弃用n/a
_wp_privacy_resend_request ( $request_id )
访问:
  • private
参数:
  • (int) $request_id Request ID.
    Required: Yes
返回:
  • (bool|WP_Error) Returns true/false based on the success of sending the email, or a WP_Error object.
定义在:
文档:

Resend an existing request and return the result.



源码

function _wp_privacy_resend_request( $request_id ) {
	$request_id = absint( $request_id );
	$request    = get_post( $request_id );

	if ( ! $request || 'user_request' !== $request->post_type ) {
		return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) );
	}

	$result = wp_send_user_request( $request_id );

	if ( is_wp_error( $result ) ) {
		return $result;
	} elseif ( ! $result ) {
		return new WP_Error( 'privacy_request_error', __( 'Unable to initiate confirmation request.' ) );
	}

	return true;
}