y( 'enable_label' => get_theme_mod($this->get_name('__enable_label'), true) ? true : false, 'disable_mobile' => get_theme_mod($this->get_name('__disable_mobile'), false) ? true : false, 'sections' => $this->get_settings(), ) ); } } } /** * Add custom style * load only enabled * * @param string $code * * @return string */ function custom_style($code = false) { if (get_theme_mod($this->get_name('__enable'), false)) { $color = sanitize_hex_color_no_hash(get_theme_mod($this->get_name('__color'))); if ($color) { $code .= " body .c-bully { color: #{$color}; } "; } $color2 = sanitize_hex_color_no_hash(get_theme_mod($this->get_name('__color2'))); if ($color2) { $code .= " body .c-bully.c-bully--inversed { color: #{$color2}; } "; } $bg = get_theme_mod($this->get_name('__label_bg')); $bg_color = onepress_sanitize_color_alpha($bg); if ($bg_color) { $code .= " body .c-bully .c-bully__title { background-color: {$bg_color}; } "; } $color = get_theme_mod($this->get_name('__label_color')); $color = onepress_sanitize_color_alpha($color); if ($color) { $code .= " body .c-bully .c-bully__title { color: {$color}; } "; } } return $code; } /** * Inits */ function init() { add_action('wp_enqueue_scripts', array($this, 'scripts')); add_filter('onepress_custom_css', array($this, 'custom_style')); } } Onepress_Dots_Navigation::get_instance()->init();