OverwriteValues(); /* */ self::$CustomizerObject = false; } private function OverwriteValues() { $wp_customize = self::$CustomizerObject; if (isset($wp_customize->selective_refresh)) { $wp_customize->selective_refresh->add_partial('blogname', array( 'selector' => '.logofont', 'render_callback' => array($this, 'superbthemes_customizer_customize_partial_blogname'), )); $wp_customize->selective_refresh->add_partial('blogdescription', array( 'selector' => '.logodescription', 'render_callback' => array($this, 'superbthemes_customizer_customize_partial_blogdescription'), )); } $wp_customize->get_control('custom_logo')->priority = 0; $wp_customize->get_section('background_image')->panel = 'business-chat-site-bg-panel'; $wp_customize->get_control('background_color')->section = 'background_image'; $wp_customize->get_control('header_textcolor')->section = CustomizerSections::COLOR_SCHEME; $wp_customize->get_control('header_textcolor')->label = __('Logo Text Color', 'business-chat'); $wp_customize->get_control('header_textcolor')->description = __('Sets the text colors for the logo.', 'business-chat'); $wp_customize->get_control('header_textcolor')->priority = 99; $wp_customize->get_control('header_image')->section = CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT; $wp_customize->get_section(CustomizerPanels::HEADER . CustomizerSections::HEADER_DEFAULT)->title = __('Default Header', 'business-chat'); } public function superbthemes_customizer_preview_scripts() { wp_enqueue_script('business-chat-customizer-preview', get_template_directory_uri() . '/js/customizer-preview.js', array('customize-preview'), wp_get_theme()->Version, true); wp_localize_script('business-chat-customizer-preview', 'business_chat_customizer_preview_variables', array( 'LAYOUT_VARIABLES' => array( 'RANGE' => CustomizerControls::RANGE_VARIABLE_CONTROLS ) )); } public function superbthemes_customizer_scripts() { wp_enqueue_script('business-chat-customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true); } public function superbthemes_customizer_customizer_scripts() { wp_enqueue_style('business-chat-customizer-css', get_template_directory_uri() . '/css/customizer.css', array(), wp_get_theme()->Version); } public function superbthemes_customizer_customizer_footer_scripts() { echo ''; } public static function AddRefocusButtonToScripts($button) { if ($button instanceof CustomizerRefocusButton) { self::$RefocusButtons[] = $button; } } public static function GetCustomizerObject() { return self::$CustomizerObject; } /** * Render the site title for the selective refresh partial. * * @return void */ public function superbthemes_customizer_customize_partial_blogname() { bloginfo('name'); } /** * Render the site tagline for the selective refresh partial. * * @return void */ public function superbthemes_customizer_customize_partial_blogdescription() { bloginfo('description'); } public function superbthemes_customizer_scripts_final_output() { if ( CustomizerControls::GetSelectedOrDefault(CustomizerControls::BLOGFEED_COLUMNS_STYLE) === CustomizerControls::BLOGFEED_TWO_COLUMNS_MASONRY || CustomizerControls::GetSelectedOrDefault(CustomizerControls::BLOGFEED_COLUMNS_STYLE) === CustomizerControls::BLOGFEED_THREE_COLUMNS_MASONRY ) { wp_enqueue_script('business-chat-colcade-masonry', get_template_directory_uri() . '/js/lib/colcade.js', array('jquery'), wp_get_theme()->Version, false); wp_enqueue_script('business-chat-colcade-masonry-init', get_template_directory_uri() . '/js/colcade-init.js', false, wp_get_theme()->Version, true); } if (CustomizerControls::GetSelectedOrDefault(CustomizerControls::GENERAL_BOXMODE) == "1") { $boxmode_media_rule = CustomizerControls::GetSelectedOrDefault(CustomizerControls::GENERAL_BOXMODE_HIDE_MOBILE) == "1" ? "all and (min-width: 600px)" : "all"; wp_enqueue_style('business-chat-boxed', get_template_directory_uri() . '/css/boxed-theme-mode.css', array(), wp_get_theme()->Version, $boxmode_media_rule); } if ( CustomizerControls::GetSelectedOrDefault(CustomizerControls::NAVIGATION_LAYOUT_STYLE) === CustomizerControls::NAVIGATION_LAYOUT_CHOICE_BUSINESS ) { wp_enqueue_script('business-chat-search-bar', get_template_directory_uri() . '/js/search-bar.js', false, wp_get_theme()->Version, true); } } public function superbthemes_customizer_css_final_output() { ?> posts as $business_chat_current_post_in_loop) { if ($business_chat_has_first_row_current_idx >= $business_chat_has_first_row_idx_max) { break; } $this_has_image = has_post_thumbnail($business_chat_current_post_in_loop->ID); if ($this_has_image) { $business_chat_has_first_row_image = true; break; } $business_chat_has_first_row_current_idx++; } return $business_chat_has_first_row_image; } /* **************************************************************************************** */ } public static function MaybeGetMasonryColumnOutput() { $selected_blog_style = CustomizerControls::GetSelectedOrDefault(CustomizerControls::BLOGFEED_COLUMNS_STYLE); if ( $selected_blog_style === CustomizerControls::BLOGFEED_TWO_COLUMNS_MASONRY || $selected_blog_style === CustomizerControls::BLOGFEED_THREE_COLUMNS_MASONRY ) { $col_amount = $selected_blog_style === CustomizerControls::BLOGFEED_TWO_COLUMNS_MASONRY ? 2 : 3; for ($i = 1; $i <= $col_amount; $i++) { echo '
'; } } } }