'aazeen_service_widget aazeen_widgtes', 'description' => __( 'You can add use this widgte in any section or page', 'aazeen-extension' ), 'customize_selective_refresh' => true, ); parent::__construct( 'aazeen_service_widget', __( 'Aazeen - Service widget (style 1)', 'aazeen-extension' ), $widget_ops ); $this->alt_option_name = 'aazeen_service_widget'; add_action('wp_enqueue_scripts', array(&$this, 'aazeen_service1_style')); include "default.php"; $this->defaults = $defaults_service_widget; } function widget($args, $instance) { $bg_color = isset( $instance['bg_color'] ) ? $instance['bg_color'] : '#BCBDD4'; $button1_color = isset( $instance['button1_color'] ) ? $instance['button1_color'] : '#1abc9c'; $button_style = isset( $instance['button_style'] ) ? $instance['button_style'] : 'btn-round'; $content_bgimage = isset( $instance['content_bgimage'] ) ? $instance['content_bgimage'] : ''; if ( 225 > ariColor::newColor( $bg_color )->luminance ) { // Our background color is dark, so we need to create a light text color. $text_color ='#fff'; } else { // Our background color is light, so we need to create a dark text color $text_color = '#000' ; } if ( 225 > ariColor::newColor( $button1_color )->luminance ) { // Our background color is dark, so we need to create a light text color. $button1_color_bg = '#fff'; } else { // Our background color is light, so we need to create a dark text color $button1_color_bg = '#000' ; } $button1_color_bg = esc_attr( $button1_color_bg ); extract($args); $instance = wp_parse_args((array) $instance, $this->defaults); echo $before_widget; ?> id; ?> id; echo ""; } ?>

defaults); ?>

option_name ); if ( empty( $settings ) ) { return; } foreach ( $settings as $instance_id => $instance ) { $id = $this->id_base . '-' . $instance_id; if ( ! is_active_widget( false, $id, $this->id_base ) ) { continue; } $bg_color = '#ffffff'; $button1_color= '#1abc9c'; if ( ! empty( $instance['button1_color'] ) ) { $button1_color = esc_attr($instance['button1_color']); } if ( ! empty( $instance['bg_color'] ) ) { $bg_color = esc_html($instance['bg_color']); } $id= $this->id; $inline_css=''; /* Color calculation for text */ if ( 225 > ariColor::newColor( $bg_color )->luminance ) { // Our background color is dark, so we need to create a light text color. $text_color ='#fff'; } else { // Our background color is light, so we need to create a dark text color $text_color = '#000' ; } $text_color = esc_attr( $text_color ); /* Color calculation for text */ $inline_css .= "#".$id." .feature .feature__title, #".$id." .feature .feature__content p { color: $text_color ; }" ; /*----------- button one -----------*/ $inline_css .= " #".$id." .feature .btn.btn-primary { background-color: $button1_color ; border-color:$button1_color; box-shadow:0 2px 2px 0 " . Kirki_Color::get_rgba($button1_color, .14) . ",0 3px 1px -2px " . Kirki_Color::get_rgba($button1_color, .2) . ",0 1px 5px 0 " . Kirki_Color::get_rgba($button1_color, .12) . "; }" ; if ( 225 > ariColor::newColor( $button1_color )->luminance ) { // Our background color is dark, so we need to create a light text color. $button1_color_bg = '#fff'; } else { // Our background color is light, so we need to create a dark text color $button1_color_bg = '#000' ; } $button1_color_bg = esc_attr( $button1_color_bg ); /* Color calculation for text */ $inline_css .= "#".$id." .feature .btn.btn-primary { color: $button1_color_bg; }" ; wp_add_inline_style( 'aazeen-style', $inline_css ); } } } } // register aazeen_ex dual category posts widget function aazeen_ex_service_widget() { register_widget( 'aazeen_service_widget' ); } add_action( 'widgets_init', 'aazeen_ex_service_widget' );