Last active
April 1, 2019 10:22
-
-
Save Ashanna/0e5594c04eef1a2cd9f0beb9f5036904 to your computer and use it in GitHub Desktop.
[Easy Booking] Add a description text before the datepickers (Easy Booking > 2.0)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* This function will display a different information text whether there is one or two date(s) to select. | |
* @param str $text - The information text (empty by default) | |
* @param WC_Product or WC_Product_Variation - Product or variation object | |
* | |
* @return str $text | |
* | |
**/ | |
add_filter( 'easy_booking_information_text', 'wceb_custom_info_text', 10, 2 ); | |
function wceb_custom_info_text( $text, $product ) { | |
$date_format = wceb_get_product_booking_dates( $product ); | |
if ( $date_format === 'one' ) { | |
$text = __( 'Select the date you want.', 'easy_booking' ); | |
} else { | |
$text = __( 'Select your arrival date and your departure date.', 'easy_booking' ); | |
} | |
return $text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment