Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Change WooCommerce "Related products" text - But makes Similar hotels untranslateable
- add_filter('gettext', 'change_rp_text', 10, 3);
- add_filter('ngettext', 'change_rp_text', 10, 3);
- function change_rp_text($translated, $text, $domain)
- {
- if ($text === 'Related products' && $domain === 'woocommerce') {
- $translated = esc_html__('Similar hotel deals', $domain);
- }
- return $translated;
- }
- /**
- * Rename product data tabs - but makes Booking information untranslatable
- */
- add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
- function woo_rename_tabs( $tabs ) {
- $tabs['additional_information']['title'] = __( 'Booking information' ); // Rename the additional information tab
- return $tabs;
- }
- // Change default sorting in Woocommerce to A to Z - bit makes Sort from A to Z untranslatable
- add_filter( 'woocommerce_catalog_orderby', 'misha_rename_default_sorting_options' );
- function misha_rename_default_sorting_options( $options ){
- unset( $options[ 'menu_order' ] ); // remove
- $options[ 'menu_order' ] = 'Sort from A to Z'; // rename
- return $options;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement