• wpbokomaru

    (@wpbokomaru)


    Hi,

    while doing reservation, in several places word “adult” appears. How to change this to “guest”? Using “adult” will cause some people not include children in reservation.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author benitolopez

    (@benitolopez)

    Hello, there’s no any option for that. You need to replace the text manually.

    You can use something like this:

    function hotelier_custom_adults_text( $translated_text, $untranslated_text, $domain ) {
    if ( $domain !== 'wp-hotelier' ) {
    return $translated_text;
    }

    $translated_text = str_replace( 'Adults', 'Guests', $translated_text );
    $translated_text = str_replace( 'Adult', 'Guest', $translated_text );

    return $translated_text;
    }
    add_filter( 'gettext', 'hotelier_custom_adults_text', 10, 3 );
    Thread Starter wpbokomaru

    (@wpbokomaru)

    Hi, where should I put this code?

    Plugin Author benitolopez

    (@benitolopez)

    In functions.php of your child theme.

    Thread Starter wpbokomaru

    (@wpbokomaru)

    It didn’t work. Additional problem I have is, that page disappeared while logged in to wordpress.com. The case is probably, date picker remembers dates; once date is past, page disappears – to open it I have to move to private mode.

    Now I probably entered interdependent problems I can’t solve ??

    Plugin Author benitolopez

    (@benitolopez)

    Just select another date here: https://thimarigardens.com/accommodations/

    If dates are invalid, then the session is emptied. This is correct and expected. You can’t make a reservation with the wrong dates.

    Regarding the other issue, try to change the code to:

    function hotelier_custom_adults_text( $translated_text, $untranslated_text, $domain ) {
    if ( $domain !== 'wp-hotelier' && $domain !== 'wp-hotelier-advanced-pricing-system' ) {
    return $translated_text;
    }

    $translated_text = str_replace( 'Adults', 'Guests', $translated_text );
    $translated_text = str_replace( 'Adult', 'Guest', $translated_text );

    return $translated_text;
    }
    add_filter( 'gettext', 'hotelier_custom_adults_text', 10, 3 );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘“Adult” word replacement’ is closed to new replies.