| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @version 1.0 |
| 4 | 4 | * @package Booking Calendar |
| @@ -24,25 +24,29 @@ | ||
| 24 | 24 | * @param $resource_id |
| 25 | 25 | * |
| 26 | 26 | * @return string |
| 27 | 27 | */ |
| 28 | -function wpbc_get_resource_title( $resource_id = 1 ) { | |
| 28 | +function wpbc_get_resource_title( $resource_id = 1 ) { | |
| 29 | 29 | |
| 30 | 30 | $resource_title = ''; |
| 31 | 31 | |
| 32 | - if ( function_exists( 'wpbc_db__get_resource_title' ) ) { | |
| 32 | + if ( function_exists( 'wpbc_db__get_resource_title' ) ) { | |
| 33 | 33 | |
| 34 | 34 | $resource_title = wpbc_db__get_resource_title( $resource_id ); |
| 35 | 35 | |
| 36 | 36 | if (! empty($resource_title)) { |
| 37 | 37 | $resource_title = wpbc_lang( $resource_title ); |
| 38 | - } | |
| 39 | - } | |
| 38 | + } | |
| 39 | + } | |
| 40 | + if ( '' === $resource_title && function_exists( 'wpbc_booking_resource_content_repository' ) ) { | |
| 41 | + $resource_content = wpbc_booking_resource_content_repository()->get( $resource_id ); | |
| 42 | + $resource_title = ! empty( $resource_content['title'] ) ? wpbc_lang( $resource_content['title'] ) : ''; | |
| 43 | + } | |
| 44 | + | |
| 45 | + return $resource_title; | |
| 46 | +} | |
| 40 | 47 | |
| 41 | - return $resource_title; | |
| 42 | -} | |
| 43 | 48 | |
| 44 | - | |
| 45 | 49 | /** |
| 46 | 50 | * Get parent booking resource title (translated/localized) |
| 47 | 51 | * |
| 48 | 52 | * @param $resource_id |
| @@ -500,10 +504,10 @@ | ||
| 500 | 504 | list( $replace['creation_year'], $replace['creation_month'], $replace['creation_day'] ) = explode( '-', $creation_date[0] ); |
| 501 | 505 | list( $replace['creation_hour'], $replace['creation_minutes'], $replace['creation_seconds'] ) = explode( ':', $creation_date[1] ); |
| 502 | 506 | } |
| 503 | 507 | |
| 504 | - return $replace; | |
| 505 | -} | |
| 508 | + return $replace; | |
| 509 | +} | |
| 506 | 510 | |
| 507 | 511 | /** |
| 508 | 512 | * Get additional parameters to the replace array for specific booking |
| 509 | 513 | * |