| @@ -9,8 +9,12 @@ | ||
| 9 | 9 | * |
| 10 | 10 | * @modified 2013.10.16 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit; // Exit if accessed directly. | |
| 15 | +} | |
| 16 | + | |
| 13 | 17 | class WPBC_CSS extends WPBC_JS_CSS { |
| 14 | 18 | |
| 15 | 19 | public function define() { |
| 16 | 20 | |
| @@ -49,21 +53,19 @@ | ||
| 49 | 53 | } |
| 50 | 54 | |
| 51 | 55 | |
| 52 | 56 | public function enqueue( $where_to_load ) { |
| 53 | - //FixIn: 9.8.1. | |
| 54 | - wp_enqueue_style( 'wpdevelop-bts', wpbc_plugin_url( '/assets/libs/bootstrap-css/css/bootstrap.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1.1. | |
| 55 | - wp_enqueue_style( 'wpdevelop-bts-theme', wpbc_plugin_url( '/assets/libs/bootstrap-css/css/bootstrap-theme.css' ), array(), WP_BK_VERSION_NUM ); | |
| 56 | - wp_enqueue_style( 'wpbc-tippy-popover', wpbc_plugin_url( '/assets/libs/tippy.js/themes/wpbc-tippy-popover.css' ), array(), WP_BK_VERSION_NUM ); | |
| 57 | - wp_enqueue_style( 'wpbc-tippy-times', wpbc_plugin_url( '/assets/libs/tippy.js/themes/wpbc-tippy-times.css' ), array(), WP_BK_VERSION_NUM ); | |
| 58 | - wp_enqueue_style( 'wpbc-material-design-icons', wpbc_plugin_url( '/assets/libs/material-design-icons/material-design-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.2.1.4. | |
| 59 | - wp_enqueue_style( 'wpbc-ui-both', wpbc_plugin_url( '/css/wpbc_ui_both.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 10.0.0.25. | |
| 60 | 57 | |
| 58 | + wp_enqueue_style( 'wpdevelop-bts', wpbc_plugin_url( '/vendors/_custom/bootstrap-css/css/bootstrap.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1.1. | |
| 59 | + wp_enqueue_style( 'wpdevelop-bts-theme', wpbc_plugin_url( '/vendors/_custom/bootstrap-css/css/bootstrap-theme.css' ), array(), WP_BK_VERSION_NUM ); | |
| 60 | + wp_enqueue_style( 'wpbc-tippy-popover', wpbc_plugin_url( '/vendors/_custom/tippy.js/themes/wpbc-tippy-popover.css' ), array(), WP_BK_VERSION_NUM ); | |
| 61 | + wp_enqueue_style( 'wpbc-tippy-times', wpbc_plugin_url( '/vendors/_custom/tippy.js/themes/wpbc-tippy-times.css' ), array(), WP_BK_VERSION_NUM ); | |
| 62 | + wp_enqueue_style( 'wpbc-material-design-icons', wpbc_plugin_url( '/vendors/_custom/material-design-icons/material-design-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.2.1.4. | |
| 63 | + wp_enqueue_style( 'wpbc-ui-both', wpbc_plugin_url( '/css/wpbc_ui_both.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 10.0.0.25. | |
| 64 | + | |
| 61 | 65 | if ( 'admin' === $where_to_load ) { // Admin CSS files. |
| 62 | - wp_enqueue_style( 'wpbc-bootstrap-icons', wpbc_plugin_url( '/assets/libs/bootstrap-icons/bootstrap-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1. | |
| 63 | - // Several concataned css files. | |
| 64 | - wp_enqueue_style( 'wpbc-all-admin', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_admin.min.css' ), array(), WP_BK_VERSION_NUM ); | |
| 65 | - | |
| 66 | + wp_enqueue_style( 'wpbc-bootstrap-icons', wpbc_plugin_url( '/vendors/_custom/bootstrap-icons/bootstrap-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1. | |
| 67 | + wp_enqueue_style( 'wpbc-all-admin', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_admin.min.css' ), array(), WP_BK_VERSION_NUM ); // Several concataned css files. | |
| 66 | 68 | wp_enqueue_style( 'wpbc-admin-support', wpbc_plugin_url( '/core/any/css/admin-support.css' ), array(), WP_BK_VERSION_NUM); |
| 67 | 69 | wp_enqueue_style( 'wpbc-admin-menu', wpbc_plugin_url( '/core/any/css/admin-menu.css' ), array(), WP_BK_VERSION_NUM); |
| 68 | 70 | wp_enqueue_style( 'wpbc-admin-toolbar', wpbc_plugin_url( '/core/any/css/admin-toolbar.css' ), array(), WP_BK_VERSION_NUM); |
| 69 | 71 | wp_enqueue_style( 'wpbc-settings-page', wpbc_plugin_url( '/core/any/css/settings-page.css' ), array(), WP_BK_VERSION_NUM); |
| @@ -68,67 +70,37 @@ | ||
| 68 | 70 | wp_enqueue_style( 'wpbc-admin-toolbar', wpbc_plugin_url( '/core/any/css/admin-toolbar.css' ), array(), WP_BK_VERSION_NUM); |
| 69 | 71 | wp_enqueue_style( 'wpbc-settings-page', wpbc_plugin_url( '/core/any/css/settings-page.css' ), array(), WP_BK_VERSION_NUM); |
| 70 | 72 | wp_enqueue_style( 'wpbc-admin-listing-table', wpbc_plugin_url( '/core/any/css/admin-listing-table.css' ), array(), WP_BK_VERSION_NUM); |
| 71 | 73 | wp_enqueue_style( 'wpbc-br-table', wpbc_plugin_url( '/core/any/css/admin-br-table.css' ), array(), WP_BK_VERSION_NUM); |
| 72 | - // Flex: Booking resources Table // FixIn: 9.9.0.7. | |
| 73 | - wp_enqueue_style( 'wpbc-flex-table', wpbc_plugin_url( '/core/any/css/wpbc_flextable.css' ), array(), WP_BK_VERSION_NUM); | |
| 74 | + wp_enqueue_style( 'wpbc-flex-table', wpbc_plugin_url( '/core/any/css/wpbc_flextable.css' ), array(), WP_BK_VERSION_NUM); // Flex: Booking resources Table // FixIn: 9.9.0.7. | |
| 74 | 75 | wp_enqueue_style( 'wpbc-admin-modal-popups', wpbc_plugin_url( '/css/modal.css' ), array(), WP_BK_VERSION_NUM); |
| 75 | - wp_enqueue_style( 'wpbc-admin-pages', wpbc_plugin_url( '/css/admin.css' ), array(), WP_BK_VERSION_NUM); | |
| 76 | - wp_enqueue_style( 'wpbc-admin-skin', wpbc_plugin_url( '/css/admin-skin.css' ), array( 'wpbc-admin-pages' ), WP_BK_VERSION_NUM ); // FixIn: 8.0.2.4. | |
| 76 | + wp_enqueue_style( 'wpbc-admin-pages', wpbc_plugin_url( '/css/admin.css' ), array(), WP_BK_VERSION_NUM); | |
| 77 | + wp_enqueue_style( 'wpbc-admin-skin', wpbc_plugin_url( '/css/admin-skin.css' ), array( 'wpbc-admin-pages' ), WP_BK_VERSION_NUM ); // FixIn: 8.0.2.4. | |
| 78 | + wp_enqueue_style( 'wpbc-admin-components', wpbc_plugin_url( '/includes/_toolbar_ui/_out/wpbc_admin_components.css' ), array( 'wpbc-admin-skin' ), WP_BK_VERSION_NUM ); // Reusable components that must override legacy administration compatibility styles. | |
| 77 | 79 | |
| 78 | - | |
| 79 | 80 | $wpbc_inline_css = ''; |
| 80 | - if ( ( ! class_exists( 'wpdev_bk_personal' ) ) || ( wpbc_mu__is_simulated_login_as_user() ) ) { // FixIn: 10.1.5.2. | |
| 81 | - // FixIn: 10.1.3.1. | |
| 82 | - //$wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(-n+1) a { color: #adc636; } "; | |
| 83 | - if ( 'hide' !== get_bk_option( 'booking_menu_go_pro' ) ) { | |
| 84 | - // Mark last item in menu 'Get Pro' as a button | |
| 85 | - //$wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { font-weight: 600;background-color: #0b9300;color: #fff;margin: 10px 10px 0;display: block;text-align: center;border-radius: 3px;transition: all .3s;box-shadow: none; } "; | |
| 86 | - $wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { font-weight: 600;background-color: #075c00;color: #fff;margin: 10px 10px 0;display: block;text-align: center;border-radius: 3px;transition: all .3s;box-shadow: none; } "; | |
| 87 | - $wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) { margin-top: 10px;border-top: 1px solid #535454; } "; | |
| 88 | - } | |
| 81 | + if ( wpbc_mu__is_simulated_login_as_user() ) { | |
| 82 | + // Mark last item in menu as a button. | |
| 83 | + $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { font-weight: 600;background-color: #075c00;color: #fff;margin: 10px 10px 0;display: block;text-align: center;border-radius: 3px;transition: all .3s;box-shadow: none; } '; | |
| 84 | + $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) { margin-top: 10px;border-top: 1px solid #535454; } '; | |
| 89 | 85 | } else { |
| 90 | 86 | // Horizontal Lines in Menu. // FixIn: 10.1.3.1. |
| 91 | - $wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-child(4) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } "; | |
| 92 | - $wpbc_inline_css .= " #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } "; | |
| 87 | + $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-child(4) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } '; | |
| 88 | + $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } '; | |
| 93 | 89 | } |
| 94 | 90 | wp_add_inline_style( 'wpbc-admin-pages', $wpbc_inline_css ); |
| 91 | + } | |
| 95 | 92 | |
| 96 | - } | |
| 97 | - | |
| 98 | - | |
| 99 | - | |
| 100 | 93 | $server_request_uri = ( ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( $_SERVER['REQUEST_URI'] ) : '' ); /* phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ /* FixIn: sanitize_unslash */ |
| 101 | 94 | if ( |
| 102 | 95 | ( 'admin' !== $where_to_load ) || |
| 103 | - ( wpbc_is_new_booking_page() ) || | |
| 104 | - ( wpbc_is_setup_wizard_page() ) || | |
| 105 | - ( wpbc_is_settings_form_page() ) || | |
| 106 | - ( wpbc_is_settings_color_themes_page() ) || | |
| 96 | + ( wpbc_is_admin_page_with_frontend_booking_preview() ) || | |
| 107 | 97 | ( ( wpbc_is_settings_page() ) && ( strpos( $server_request_uri, 'tab=payment' ) !== false ) ) |
| 108 | - // || ( wpbc_is_availability_page() ) // FixIn: 10.0.0.5 Error at -> WP Booking Calendar > Availability > Season Availability page. | |
| 109 | 98 | ) { |
| 110 | - // Client or Add New Booking page. | |
| 111 | - | |
| 112 | - if ( ( 'On' === get_bk_option( 'booking_timeslot_picker' ) ) || ( wpbc_is_setup_wizard_page() ) ) { // FixIn: 8.7.11.10. | |
| 113 | - wp_enqueue_style( 'wpbc-time_picker', wpbc_plugin_url( '/css/wpbc_time-selector.css' ), array(), WP_BK_VERSION_NUM ); | |
| 114 | - | |
| 115 | - $time_picker_skin_path = wpbc_get_time_picker_skin_url(); | |
| 116 | - if ( ! empty( $time_picker_skin_path ) ) { | |
| 117 | - wp_enqueue_style( 'wpbc-time_picker-skin', $time_picker_skin_path, array( 'wpbc-time_picker' ), WP_BK_VERSION_NUM ); | |
| 118 | - } | |
| 119 | - } | |
| 120 | - wp_enqueue_style( 'wpbc-client-pages', wpbc_plugin_url( '/css/client.css' ), array(), WP_BK_VERSION_NUM ); | |
| 121 | - // Several concataned css files. | |
| 122 | - wp_enqueue_style( 'wpbc-all-client', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_client.css' ), array( 'wpbc-client-pages' ), WP_BK_VERSION_NUM ); | |
| 99 | + wpbc_enqueue_styles__front_end(); | |
| 123 | 100 | } |
| 124 | 101 | |
| 125 | - wp_enqueue_style( 'wpbc-calendar', wpbc_plugin_url( '/css/calendar.css' ), array(), WP_BK_VERSION_NUM ); | |
| 126 | - // Calendar Skins. | |
| 127 | - $calendar_skin_path = wpbc_get_calendar_skin_url(); | |
| 128 | - if ( ! empty( $calendar_skin_path ) ) { | |
| 129 | - wp_enqueue_style( 'wpbc-calendar-skin', $calendar_skin_path, array(), WP_BK_VERSION_NUM ); | |
| 130 | - } | |
| 102 | + wpbc_enqueue_styles__calendar(); | |
| 131 | 103 | |
| 132 | 104 | do_action( 'wpbc_enqueue_css_files', $where_to_load ); |
| 133 | 105 | } |
| 134 | 106 | |
| @@ -136,9 +108,15 @@ | ||
| 136 | 108 | public function remove_conflicts( $where_to_load ) { |
| 137 | 109 | |
| 138 | 110 | // FixIn: 8.1.3.12. |
| 139 | 111 | if ( |
| 140 | - wpbc_is_bookings_page() || wpbc_is_new_booking_page() || wpbc_is_setup_wizard_page() || wpbc_is_settings_form_page() || wpbc_is_settings_color_themes_page() || wpbc_is_resources_page() || wpbc_is_settings_page() ) { | |
| 112 | + wpbc_is_bookings_page() || | |
| 113 | + wpbc_is_new_booking_page() || | |
| 114 | + wpbc_is_setup_wizard_page() || | |
| 115 | + wpbc_is_settings_form_page() || | |
| 116 | + wpbc_is_resources_page() || | |
| 117 | + wpbc_is_settings_page() | |
| 118 | + ) { | |
| 141 | 119 | if ( function_exists( 'wp_dequeue_style' ) ) { |
| 142 | 120 | /** |
| 143 | 121 | // wp_dequeue_style( 'cs-alert' ); |
| 144 | 122 | // wp_dequeue_style( 'cs-framework' ); |
| @@ -163,8 +141,43 @@ | ||
| 163 | 141 | } |
| 164 | 142 | |
| 165 | 143 | |
| 166 | 144 | /** |
| 145 | + * Integrate CSS files required for front-end side. | |
| 146 | + * | |
| 147 | + * @return void | |
| 148 | + */ | |
| 149 | +function wpbc_enqueue_styles__front_end() { | |
| 150 | + | |
| 151 | + // Client or Add New Booking page. | |
| 152 | + if ( ( 'On' === get_bk_option( 'booking_timeslot_picker' ) ) || wpbc_is_setup_wizard_page() || wpbc_is_builder_booking_form_page() || wpbc_is_settings_themes_page() ) { // FixIn: 8.7.11.10. | |
| 153 | + wp_enqueue_style( 'wpbc-time_picker', wpbc_plugin_url( '/css/wpbc_time-selector.css' ), array(), WP_BK_VERSION_NUM ); | |
| 154 | + | |
| 155 | + $time_picker_skin_path = wpbc_get_time_picker_skin_url(); | |
| 156 | + if ( ! empty( $time_picker_skin_path ) ) { | |
| 157 | + wp_enqueue_style( 'wpbc-time_picker-skin', $time_picker_skin_path, array( 'wpbc-time_picker' ), WP_BK_VERSION_NUM ); | |
| 158 | + } | |
| 159 | + } | |
| 160 | + wp_enqueue_style( 'wpbc-client-pages', wpbc_plugin_url( '/css/client.css' ), array(), WP_BK_VERSION_NUM ); | |
| 161 | + wp_enqueue_style( 'wpbc-all-client', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_client.css' ), array( 'wpbc-client-pages' ), WP_BK_VERSION_NUM ); // Several concataned css files. | |
| 162 | + | |
| 163 | +} | |
| 164 | + | |
| 165 | +function wpbc_enqueue_styles__calendar() { | |
| 166 | + | |
| 167 | + wp_enqueue_style( 'wpbc-calendar', wpbc_plugin_url( '/css/calendar.css' ), array(), WP_BK_VERSION_NUM ); | |
| 168 | + | |
| 169 | + // Calendar Skins. | |
| 170 | + $calendar_skin_path = wpbc_get_calendar_skin_url(); | |
| 171 | + if ( ! empty( $calendar_skin_path ) ) { | |
| 172 | + wp_enqueue_style( 'wpbc-calendar-skin', $calendar_skin_path, array(), WP_BK_VERSION_NUM ); | |
| 173 | + } | |
| 174 | + | |
| 175 | +} | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | +/** | |
| 167 | 180 | * Get URL to Calendar Skin ( CSS file ) |
| 168 | 181 | * |
| 169 | 182 | * @return string - URL to calendar skin |
| 170 | 183 | */ |
| @@ -169,9 +182,9 @@ | ||
| 169 | 182 | * @return string - URL to calendar skin |
| 170 | 183 | */ |
| 171 | 184 | function wpbc_get_calendar_skin_url() { |
| 172 | 185 | |
| 173 | - // -- Old 'inc' path -> Re-update // FixIn: 8.7.11.11. | |
| 186 | + // -- Old 'inc' path -> Re-update // FixIn: 8.7.11.11. | |
| 174 | 187 | $check_skin_path = get_bk_option( 'booking_skin' ); |
| 175 | 188 | if ( false !== strpos( $check_skin_path, 'inc/skins/' ) ) { |
| 176 | 189 | $check_skin_path = str_replace( 'inc/skins/', 'css/skins/', $check_skin_path ); |
| 177 | 190 | update_bk_option( 'booking_skin', $check_skin_path ); |
| @@ -184,60 +197,62 @@ | ||
| 184 | 197 | |
| 185 | 198 | |
| 186 | 199 | $calendar_skin_path = false; |
| 187 | 200 | // ----------------------------------------------------------------------------------------------------------------- |
| 188 | - // Check if this skin exist in Usual folder | |
| 201 | + // Check if this skin exist in Usual folder. | |
| 189 | 202 | // ----------------------------------------------------------------------------------------------------------------- |
| 190 | - if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') ) ) ) { | |
| 191 | - $calendar_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') ); | |
| 192 | - } | |
| 203 | + if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') ) ) ) { | |
| 204 | + $calendar_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') ); | |
| 205 | + } | |
| 193 | 206 | |
| 194 | 207 | // ----------------------------------------------------------------------------------------------------------------- |
| 195 | - // Check if skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/ | |
| 208 | + // Check if skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/ | |
| 196 | 209 | // ----------------------------------------------------------------------------------------------------------------- |
| 197 | - $upload_dir = wp_upload_dir(); | |
| 198 | - $custom_user_skin_folder = $upload_dir['basedir'] ; | |
| 199 | - $custom_user_skin_url = $upload_dir['baseurl'] ; //$custom_user_skin_url = str_replace( 'http:', 'https:', $custom_user_skin_url ); | |
| 210 | + $upload_dir = wp_upload_dir(); | |
| 211 | + $custom_user_skin_folder = $upload_dir['basedir']; | |
| 212 | + $custom_user_skin_url = $upload_dir['baseurl']; | |
| 200 | 213 | |
| 201 | - if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL , $custom_user_skin_url ), '', get_bk_option( 'booking_skin') ) ) ) { | |
| 202 | - $calendar_skin_path = $custom_user_skin_url . str_replace( array(WPBC_PLUGIN_URL, $custom_user_skin_url ), '', get_bk_option( 'booking_skin') ); | |
| 203 | - } | |
| 214 | + if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL , $custom_user_skin_url ), '', get_bk_option( 'booking_skin') ) ) ) { | |
| 215 | + $calendar_skin_path = $custom_user_skin_url . str_replace( array(WPBC_PLUGIN_URL, $custom_user_skin_url ), '', get_bk_option( 'booking_skin') ); | |
| 216 | + } | |
| 204 | 217 | |
| 205 | 218 | // ----------------------------------------------------------------------------------------------------------------- |
| 206 | 219 | // If still no file, then Default |
| 207 | 220 | // ----------------------------------------------------------------------------------------------------------------- |
| 208 | 221 | if ( empty( $calendar_skin_path ) ) { |
| 209 | - $calendar_skin_path = WPBC_PLUGIN_URL . '/css/skins/24_9__light.css'; | |
| 222 | + $calendar_skin_path = WPBC_PLUGIN_URL . '/css/skins/25_5__round_1.css'; | |
| 210 | 223 | } |
| 211 | 224 | |
| 212 | - return $calendar_skin_path; | |
| 225 | + return $calendar_skin_path; | |
| 213 | 226 | } |
| 214 | 227 | |
| 215 | 228 | |
| 216 | -function wpbc_get_time_picker_skin_url(){ // FixIn: 8.7.11.10. | |
| 229 | +/** | |
| 230 | + * Get URL of Time Picker Skin - checked by default of this skin exists. | |
| 231 | + * | |
| 232 | + * @return false|string | |
| 233 | + */ | |
| 234 | +function wpbc_get_time_picker_skin_url() { | |
| 217 | 235 | |
| 218 | - // time_picker Skin /////////////////////////////////////////////////////// | |
| 236 | + // Time_picker Skin. | |
| 219 | 237 | $time_picker_skin_path = false; |
| 220 | 238 | |
| 221 | - // Just default value, if previously was not saved any options. | |
| 239 | + // Just default value, if previously was not saved any options. | |
| 222 | 240 | if ( empty( get_bk_option( 'booking_timeslot_picker_skin' ) ) ) { |
| 223 | - // update_bk_option( 'booking_timeslot_picker_skin', '/css/time_picker_skins/grey.css' ); | |
| 224 | - update_bk_option( 'booking_timeslot_picker_skin', '/css/time_picker_skins/light__24_8.css' ); // FixIn: 10.4.0.1. | |
| 241 | + update_bk_option( 'booking_timeslot_picker_skin', '/css/time_picker_skins/form_style.css' ); // FixIn: 11.4.4. | |
| 225 | 242 | } |
| 226 | 243 | |
| 227 | - // Check if this skin exist in the plugin folder ////////////////////// | |
| 228 | - if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin') ) ) ) { | |
| 229 | - $time_picker_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin') ); | |
| 230 | - } | |
| 244 | + // Check if this skin exist in the plugin folder. | |
| 245 | + if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin' ) ) ) ) { | |
| 246 | + $time_picker_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin' ) ); | |
| 247 | + } | |
| 231 | 248 | |
| 232 | - // Check if this skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/ | |
| 233 | - $upload_dir = wp_upload_dir(); | |
| 234 | - $custom_user_skin_folder = $upload_dir['basedir'] ; | |
| 235 | - $custom_user_skin_url = $upload_dir['baseurl'] ; | |
| 236 | - if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL , $custom_user_skin_url ), '', get_bk_option( 'booking_timeslot_picker_skin') ) ) ) { | |
| 237 | - $time_picker_skin_path = $custom_user_skin_url . str_replace( array(WPBC_PLUGIN_URL, $custom_user_skin_url ), '', get_bk_option( 'booking_timeslot_picker_skin') ); | |
| 238 | - } | |
| 249 | + // Check if this skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/ . | |
| 250 | + $upload_dir = wp_upload_dir(); | |
| 251 | + $custom_user_skin_folder = $upload_dir['basedir']; | |
| 252 | + $custom_user_skin_url = $upload_dir['baseurl']; | |
| 253 | + if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL, $custom_user_skin_url, ), '', get_bk_option( 'booking_timeslot_picker_skin' ) ) ) ) { | |
| 254 | + $time_picker_skin_path = $custom_user_skin_url . str_replace( array( WPBC_PLUGIN_URL, $custom_user_skin_url, ), '', get_bk_option( 'booking_timeslot_picker_skin' ) ); | |
| 255 | + } | |
| 239 | 256 | |
| 240 | - return $time_picker_skin_path; | |
| 257 | + return $time_picker_skin_path; | |
| 241 | 258 | } |
| 242 | - | |
| 243 | - | |