Skip to content

Instantly share code, notes, and snippets.

@Ashanna
Last active April 1, 2019 10:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ashanna/0e5594c04eef1a2cd9f0beb9f5036904 to your computer and use it in GitHub Desktop.
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 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