65, self::BLOGFEED_COLUMNS_STYLE => self::BLOGFEED_TWO_COLUMNS_MASONRY, self::BLOGFEED_FEATURED_IMAGE_STYLE => self::BLOGFEED_FEATURED_IMAGE_CHOICE_FULL_IMAGE, self::SINGLE_FEATURED_IMAGE_STYLE => self::BLOGFEED_FEATURED_IMAGE_CHOICE_FULL_IMAGE, self::NAVIGATION_LAYOUT_STYLE => self::NAVIGATION_LAYOUT_CHOICE_BUSINESS, self::BLOGFEED_HIDE_SIDEBAR => "1", self::SINGLE_HIDE_RELATED_POSTS => "1", self::NAVIGATION_RIGHTALIGNED_BUTTON_TARGETBLANK => "1", self::NAVIGATION_SEARCHBAR_ENABLED => "", self::GENERAL_BOXMODE => "", self::GENERAL_BOXMODE_HIDE_MOBILE => "1", self::GENERAL_BORDER_RADIUS_ELEMENTS => 4, self::GENERAL_BORDER_RADIUS_BUTTONS => 4, self::SITE_IDENTITY_HIDE_TAGLINE => "1", self::BLOGFEED_SHOW_READMORE_BUTTON => "1", self::SHORTPIXEL_ENABLE => "", self::SINGLE_HIDE_BYLINE_IMAGE => "1", self::BLOGFEED_HIDE_BYLINE_IMAGE => "1" ); public function __construct() { /* */ /* * * SHORTPIXEL * */ // Requires >= WP 6.0 global $wp_version; if (version_compare($wp_version, '6') >= 0) { new CustomizerItem(self::SHORTPIXEL_ENABLE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Enable Image Optimization', 'business-chat'), "description" => __('When this setting is enabled, images on your website will be automatically optimized using ShortPixel and delivered as the modern image format .webp through their free CDN.', 'business-chat'), "section" => CustomizerSections::SHORTPIXEL, "default" => self::$CONTROL_DEFAULTS[self::SHORTPIXEL_ENABLE] )); } /* */ /* * * GENERAL * */ new CustomizerItem(self::GENERAL_BOXMODE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Boxed Layout', 'business-chat'), "description" => __('When this setting is enabled, elements on the website will be boxed.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::GENERAL, "default" => self::$CONTROL_DEFAULTS[self::GENERAL_BOXMODE] )); new CustomizerItem(self::GENERAL_BOXMODE_HIDE_MOBILE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Disable Boxed Layout on Mobile', 'business-chat'), "description" => __('When this setting is enabled, and Boxed Layout is enabled, the boxed layout will not be applied on mobile devices and other low-width screens.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::GENERAL, "default" => self::$CONTROL_DEFAULTS[self::GENERAL_BOXMODE_HIDE_MOBILE], "conditions" => array( self::GENERAL_BOXMODE => array( "1" ) ) )); /* * * HEADER METASLIDER * */ new CustomizerItem(self::HEADER_METASLIDER_SHORTCODE, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('MetaSlider Shortcode', 'business-chat'), "description" => __('Add your MetaSlider slider shortcode in this field to use the Slider as your header. This will be used instead of the default theme header.', 'business-chat'), "section" => CustomizerPanels::HEADER . CustomizerSections::HEADER_METASLIDER, "priority" => 1, )); /* * * HEADER DEFAULT * */ /* Header */ new CustomizerItem(self::HEADER_TITLE, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Title', 'business-chat'), "description" => __('The title text displayed in your header.', 'business-chat'), "section" => CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT, )); new CustomizerItem(self::HEADER_TAGLINE, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Tagline', 'business-chat'), "description" => __('The tagline text displayed in your header.', 'business-chat'), "section" => CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT, )); new CustomizerItem(self::HEADER_BUTTON_TEXT, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Button Text', 'business-chat'), "description" => __('The button text displayed in your header.', 'business-chat'), "section" => CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT, )); new CustomizerItem(self::HEADER_BUTTON_LINK, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Button Link', 'business-chat'), "description" => __('The link used by the button in your header.', 'business-chat'), "section" => CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT, )); /* * * SITE IDENTITY * */ new CustomizerItem(self::SITE_IDENTITY_LOGO_HEIGHT, array( "type" => CustomizerType::CONTROL_RANGE, "label" => __('Logo Height', 'business-chat'), "description" => __('Sets the height limit for the logo image, if once is selected.', 'business-chat'), "section" => 'title_tagline', "priority" => 1, "default" => self::$CONTROL_DEFAULTS[self::SITE_IDENTITY_LOGO_HEIGHT], "range" => array( 'min' => 25, 'max' => 200, 'step' => 1 ) )); new CustomizerItem(self::SITE_IDENTITY_HIDE_TAGLINE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Hide Tagline Only', 'business-chat'), "section" => 'title_tagline', "default" => self::$CONTROL_DEFAULTS[self::SITE_IDENTITY_HIDE_TAGLINE] )); /* * * NAVIGATION * */ /* Layout */ new CustomizerItem(self::NAVIGATION_LAYOUT_STYLE, array( "type" => CustomizerType::CONTROL_RADIO_IMAGE, "label" => __('Navigation Layout', 'business-chat'), "description" => __('Select the layout of the navigation area on your website.', 'business-chat'), "priority" => 1, "section" => CustomizerPanels::LAYOUT . CustomizerSections::NAVIGATION, "default" => self::$CONTROL_DEFAULTS[self::NAVIGATION_LAYOUT_STYLE], "choices" => array( self::NAVIGATION_LAYOUT_CHOICE_SMALL => '' . esc_html__("Small Navigation Layout", "business-chat") . '', self::NAVIGATION_LAYOUT_CHOICE_BUSINESS => '' . esc_html__("Business Navigation Layout", "business-chat") . '', ) )); new CustomizerItem(self::NAVIGATION_RIGHTALIGNED_BUTTON_TEXT, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Right-Aligned Button Text', 'business-chat'), "description" => __('If the Full Navigation Layout is active, sets the text of the button in the top right side of the navigation.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::NAVIGATION, "priority" => 1, "conditions" => array( self::NAVIGATION_LAYOUT_STYLE => array( self::NAVIGATION_LAYOUT_CHOICE_BUSINESS ) ) )); new CustomizerItem(self::NAVIGATION_RIGHTALIGNED_BUTTON_LINK, array( "type" => CustomizerType::CONTROL_TEXT, "label" => __('Right-Aligned Button Link', 'business-chat'), "description" => __('If the Full Navigation Layout is active, sets the link of the button in the top right side of the navigation.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::NAVIGATION, "priority" => 1, "conditions" => array( self::NAVIGATION_LAYOUT_STYLE => array( self::NAVIGATION_LAYOUT_CHOICE_BUSINESS ) ) )); new CustomizerItem(self::NAVIGATION_RIGHTALIGNED_BUTTON_TARGETBLANK, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Open Link in new Window/Tab', 'business-chat'), "description" => __('When this setting is enabled, the link of the button will be opened in a new window/tab when clicked.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::NAVIGATION, "priority" => 1, "default" => self::$CONTROL_DEFAULTS[self::NAVIGATION_RIGHTALIGNED_BUTTON_TARGETBLANK], "conditions" => array( self::NAVIGATION_LAYOUT_STYLE => array( self::NAVIGATION_LAYOUT_CHOICE_BUSINESS ) ) )); new CustomizerItem(self::NAVIGATION_SEARCHBAR_ENABLED, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Search Bar & Button', 'business-chat'), "description" => __('When this setting is enabled, a search button and bar will be added to the navigation layout.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::NAVIGATION, "default" => self::$CONTROL_DEFAULTS[self::NAVIGATION_SEARCHBAR_ENABLED], "conditions" => array( self::NAVIGATION_LAYOUT_STYLE => array( self::NAVIGATION_LAYOUT_CHOICE_BUSINESS ) ) )); /* * * SIDEBAR * */ /* Layout */ new CustomizerItem(self::BLOGFEED_HIDE_SIDEBAR, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Hide Sidebar on Blog Feed, Search Page and Archive Pages', 'business-chat'), "description" => __('Enabling this setting will hide the sidebar on the blog feed, search page and archive pages and use the full width of the page for the page content.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::SIDEBAR, "default" => self::$CONTROL_DEFAULTS[self::BLOGFEED_HIDE_SIDEBAR] )); /* * * BLOG FEED * */ /* Layout */ new CustomizerItem(self::BLOGFEED_COLUMNS_STYLE, array( "type" => CustomizerType::CONTROL_RADIO_IMAGE, "label" => __('Blog Feed Column Layout', 'business-chat'), "description" => __('Select the layout of the columns on your blog feed.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::BLOG, "default" => self::$CONTROL_DEFAULTS[self::BLOGFEED_COLUMNS_STYLE], "choices" => array( self::BLOGFEED_ONE_COLUMNS => '' . esc_html__("1-Column Layout", "business-chat") . '', self::BLOGFEED_TWO_COLUMNS_MASONRY => '' . esc_html__("2-Column Masonry Layout", "business-chat") . '', self::BLOGFEED_THREE_COLUMNS_MASONRY => '' . esc_html__("3-Column Masonry Layout", "business-chat") . '' ) )); new CustomizerItem(self::BLOGFEED_SHOW_READMORE_BUTTON, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Show "Continue reading" Button', 'business-chat'), "description" => __('Enabling this setting will add a "Continue reading" button below every blog post excerpt, if "Show Full Posts" is not enabled.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::BLOG, "default" => self::$CONTROL_DEFAULTS[self::BLOGFEED_SHOW_READMORE_BUTTON] )); new CustomizerItem(self::BLOGFEED_HIDE_BYLINE_IMAGE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Hide Author Image from Byline', 'business-chat'), "description" => __('Enabling this setting will hide the author image from the byline.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::BLOG, "default" => self::$CONTROL_DEFAULTS[self::BLOGFEED_HIDE_BYLINE_IMAGE] )); new CustomizerItem(self::BLOGFEED_FEATURED_IMAGE_STYLE, array( "type" => CustomizerType::CONTROL_RADIO, "label" => __('Featured Image Layout', 'business-chat'), "description" => __('Select the layout of the featured images on your blog feed.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::BLOG, "default" => self::$CONTROL_DEFAULTS[self::BLOGFEED_FEATURED_IMAGE_STYLE], "choices" => array( self::BLOGFEED_FEATURED_IMAGE_CHOICE_FULL_IMAGE => "Full Image", self::BLOGFEED_FEATURED_IMAGE_CHOICE_COVER_IMAGE => "Scale to fit Recommended Size", self::BLOGFEED_FEATURED_IMAGE_CHOICE_FULL_IMAGE_COVER_BLUR => "Keep Full Image, But Fill Background to Recommended Size" ) )); new CustomizerItem(self::BLOGFEED_FEATURED_IMAGE_PLACEHOLDER, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Display Placeholder Featured Image', 'business-chat'), "description" => __('Enabling this setting will display a placeholder featured image for all posts that do not have a featured image set.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::BLOG, "default" => 0 )); /* * * SINGLE / POSTS & PAGES / POSTS / PAGES * */ /* Layout */ new CustomizerItem(self::SINGLE_FEATURED_IMAGE_STYLE, array( "type" => CustomizerType::CONTROL_RADIO, "label" => __('Featured Image Layout', 'business-chat'), "description" => __('Select the layout of the featured images on your blog feed.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::SINGLE, "default" => self::$CONTROL_DEFAULTS[self::SINGLE_FEATURED_IMAGE_STYLE], "choices" => array( self::SINGLE_FEATURED_IMAGE_CHOICE_FULL_IMAGE => "Full Image", self::SINGLE_FEATURED_IMAGE_CHOICE_COVER_IMAGE => "Scale to fit Recommended Size", self::SINGLE_FEATURED_IMAGE_CHOICE_FULL_IMAGE_COVER_BLUR => "Keep Full Image, But Fill Background to Recommended Size" ) )); new CustomizerItem(self::SINGLE_HIDE_BYLINE_IMAGE, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Hide Author Image from Byline', 'business-chat'), "description" => __('Enabling this setting will hide the author image from the byline.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::SINGLE, "default" => self::$CONTROL_DEFAULTS[self::SINGLE_HIDE_BYLINE_IMAGE] )); new CustomizerItem(self::SINGLE_HIDE_RELATED_POSTS, array( "type" => CustomizerType::CONTROL_CHECKBOX, "label" => __('Hide Related Posts', 'business-chat'), "description" => __('Enabling this setting will hide the related posts section.', 'business-chat'), "section" => CustomizerPanels::LAYOUT . CustomizerSections::SINGLE, "default" => self::$CONTROL_DEFAULTS[self::SINGLE_HIDE_RELATED_POSTS] )); } public static function OverwriteDefault($control, $value) { self::$CONTROL_DEFAULTS[$control] = $value; } public static function GetSelectedOrDefault($control) { $theme_mod = \get_theme_mod($control); if (($theme_mod || empty($theme_mod)) && $theme_mod !== false) { return $theme_mod; } return self::GetDefault($control); } public static function GetDefault($control) { if (isset(self::$CONTROL_DEFAULTS[$control])) { return self::$CONTROL_DEFAULTS[$control]; } // No default for control found return false; } }