PluginProbe
Booking Calendar / 11.3
Booking Calendar v11.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 10.11.3 All 202 releases
booking / includes / _front_end / class-fe-settings.php

class-fe-settings.php in Booking Calendar 11.3, at includes/_front_end/class-fe-settings.php

56 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Front-end booking form settings helpers.
4 *
5 * @package Booking Calendar
6 * @since 11.2.1.1
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 if ( ! class_exists( 'WPBC_Frontend_Settings' ) ) {
14
15 /**
16 * Shared front-end settings helper.
17 */
18 class WPBC_Frontend_Settings {
19
20 /**
21 * Is the BFB feature compiled/available in this build.
22 *
23 * @return bool
24 */
25 public static function is_bfb_feature_available() {
26 return ( defined( 'WPBC_NEW_FORM_BUILDER' ) && WPBC_NEW_FORM_BUILDER );
27 }
28
29 /**
30 * Is BFB enabled in settings.
31 *
32 * @param mixed $ctx Optional context for filters.
33 *
34 * @return bool
35 */
36 public static function is_bfb_enabled( $ctx = null ) {
37
38 if ( ! self::is_bfb_feature_available() ) {
39 return false;
40 }
41
42 $is_enabled = ( 'On' === get_bk_option( 'booking_use_bfb_form' ) );
43
44 /**
45 * Allow forcing enable/disable externally if needed.
46 *
47 * @param bool $is_enabled
48 * @param mixed $ctx
49 */
50 $is_enabled = (bool) apply_filters( 'wpbc_frontend_is_bfb_enabled', $is_enabled, $ctx );
51
52 return $is_enabled;
53 }
54 }
55 }
56