PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | includes/_functions/booking_data__get.php +13 -9 11.111.8.3 View file →
@@ -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 *