Resolved Missing “In Progress” Appointment Status in BookingPress

Description

BookingPress may output variations such as Rejected Appointment or Appointment Rejected. This version replaces the word anywhere in BookingPress text:
Paste this code in the functions.php

PHP Source Code

                        
                          /**
 * Replace every visible BookingPress occurrence of
 * "Rejected" with "In-Progress".
 */
function stack_hustle_replace_bookingpress_rejected_text(
    $translated_text,
    $text,
    $domain
) {
    $bookingpress_domains = array(
        'bookingpress-appointment-booking',
        'bookingpress'
    );

    if (!in_array($domain, $bookingpress_domains, true)) {
        return $translated_text;
    }

    $translated_text = str_ireplace(
        array(
            'Rejected',
            'Appointment Rejected',
            'Rejected Appointment'
        ),
        array(
            'In-Progress',
            'Appointment In-Progress',
            'In-Progress Appointment'
        ),
        $translated_text
    );

    return $translated_text;
}

add_filter(
    'gettext',
    'stack_hustle_replace_bookingpress_rejected_text',
    20,
    3
);                        
                        


Post Categories