Skip to content

Instantly share code, notes, and snippets.

@benitolopez
Last active March 13, 2023 22:30
Show Gist options
  • Select an option

  • Save benitolopez/eeb7ee3707544ae9a4450497d454a817 to your computer and use it in GitHub Desktop.

Select an option

Save benitolopez/eeb7ee3707544ae9a4450497d454a817 to your computer and use it in GitHub Desktop.
<?php
/**
* This function changes the word "Room/s" to "Cabin/s"
*/
function custom_hotelier_word_for_rooms( $translated ) {
if ( ! is_admin() ) {
$translated = str_replace( 'Rooms', 'Cabins', $translated );
$translated = str_replace( 'rooms', 'cabins', $translated );
$translated = str_replace( 'Room', 'Cabin', $translated );
$translated = str_replace( 'room', 'cabin', $translated );
}
return $translated;
}
add_filter('gettext', 'custom_hotelier_word_for_rooms');
add_filter('gettext_with_context', 'custom_hotelier_word_for_rooms');
add_filter('ngettext', 'custom_hotelier_word_for_rooms');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment