_wp_privacy_resend_request example

/** * Handle list table actions. * * @since 4.9.6 * @access private */
function _wp_personal_data_handle_actions() {
    if ( isset( $_POST['privacy_action_email_retry'] ) ) {
        check_admin_referer( 'bulk-privacy_requests' );

        $request_id = absint( current( array_keys( (array) wp_unslash( $_POST['privacy_action_email_retry'] ) ) ) );
        $result     = _wp_privacy_resend_request( $request_id );

        if ( is_wp_error( $result ) ) {
            add_settings_error(
                'privacy_action_email_retry',
                'privacy_action_email_retry',
                $result->get_error_message(),
                'error'
            );
        } else {
            add_settings_error(
                'privacy_action_email_retry',
                
return;
        }

        $count    = 0;
        $failures = 0;

        check_admin_referer( 'bulk-privacy_requests' );

        switch ( $action ) {
            case 'resend':
                foreach ( $request_ids as $request_id ) {
                    $resend = _wp_privacy_resend_request( $request_id );

                    if ( $resend && ! is_wp_error( $resend ) ) {
                        $count++;
                    } else {
                        $failures++;
                    }
                }

                if ( $failures ) {
                    add_settings_error(
                        'bulk_action',
                        
Home | Imprint | This part of the site doesn't use cookies.