'widget_contact_info', 'description' => esc_html__( 'Contact information', 'apollo13-framework-extensions' ) ); parent::__construct( 'contact-info', esc_html__( 'Apollo13Themes', 'apollo13-framework-extensions' ) . ' - ' . esc_html__( 'Contact information', 'apollo13-framework-extensions' ), $widget_ops ); $this->alt_option_name = 'widget_contact_info'; add_action( 'save_post', array( &$this, 'flush_midget_cache' ) ); add_action( 'deleted_post', array( &$this, 'flush_midget_cache' ) ); add_action( 'switch_theme', array( &$this, 'flush_midget_cache' ) ); } function widget( $args, $instance ) { $before_widget = $after_widget = $before_title = $after_title = ''; $cache = wp_cache_get( 'widget_contact_info', 'widget' ); if ( ! is_array( $cache ) ) { $cache = array(); } if ( isset( $cache[ $args['widget_id'] ] ) ) { print $cache[ $args['widget_id'] ]; return; } ob_start(); extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? esc_html__( 'Contact information', 'apollo13-framework-extensions' ) : $instance['title'], $instance, $this->id_base ); print $before_widget; if ( $title ) { print $before_title . $title . $after_title; } echo '
'; if ( ! empty( $instance['content'] ) ) { echo '
' . nl2br( wp_kses_data( balanceTags( $instance['content'], true ) ) ) . '
'; } if ( ! empty( $instance['phone'] ) ) { echo '
' . esc_html( $instance['phone'] ) . '
'; } if ( ! empty( $instance['fax'] ) ) { echo '
' . esc_html( $instance['fax'] ) . '
'; } if ( ! empty( $instance['email'] ) ) { $email = $instance['email']; $email = sanitize_email($email); echo ''.esc_html( antispambot($email) ).''; } if ( ! empty( $instance['www'] ) ) { echo '' . esc_html( $instance['www'] ) . ''; } if ( ! empty( $instance['open'] ) ) { echo '
' . nl2br( wp_kses_data( balanceTags( $instance['open'], true ) ) ) . '
'; } echo '
'; print $after_widget; $cache[ $args['widget_id'] ] = ob_get_flush(); wp_cache_set( 'widget_related_entries', $cache, 'widget' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['phone'] = strip_tags( $new_instance['phone'] ); $instance['email'] = strip_tags( $new_instance['email'] ); $instance['fax'] = strip_tags( $new_instance['fax'] ); $instance['www'] = strip_tags( $new_instance['www'] ); $instance['content'] = $new_instance['content']; $instance['open'] = strip_tags( $new_instance['open'] ); $this->flush_midget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset( $alloptions['widget_contact_info'] ) ) { delete_option( 'widget_contact_info' ); } return $instance; } function flush_midget_cache() { wp_cache_delete( 'widget_contact_info', 'widget' ); } function form( $instance ) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $phone = isset( $instance['phone'] ) ? esc_attr( $instance['phone'] ) : ''; $email = isset( $instance['email'] ) ? esc_attr( $instance['email'] ) : ''; $fax = isset( $instance['fax'] ) ? esc_attr( $instance['fax'] ) : ''; $www = isset( $instance['www'] ) ? esc_attr( $instance['www'] ) : ''; $content = isset( $instance['content'] ) ? esc_textarea( $instance['content'] ) : ''; $open = isset( $instance['open'] ) ? esc_textarea( $instance['open'] ) : ''; ?>

'widget_shortcodes', 'description' => esc_html__( 'Widget for placing shortcodes.', 'apollo13-framework-extensions' ) ); $control_ops = array( 'width' => 400, 'height' => 350 ); parent::__construct( 'a13-shortcodes', esc_html__( 'Apollo13Themes', 'apollo13-framework-extensions' ) . ' - ' . esc_html__( 'Shortcodes', 'apollo13-framework-extensions' ), $widget_ops, $control_ops ); } function widget( $args, $instance ) { $before_widget = $after_widget = $before_title = $after_title = ''; extract( $args ); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ); print $before_widget; if ( ! empty( $title ) ) { print $before_title . $title . $after_title; } ?>
'', 'text' => '' ) ); $title = strip_tags( $instance['title'] ); $text = esc_textarea( $instance['text'] ); ?>

/> 

'widget_a13_social_icons', 'description' => esc_html__( 'Social icons from the theme settings', 'apollo13-framework-extensions' ) ); parent::__construct( 'a13-social-icons', esc_html__( 'Apollo13Themes', 'apollo13-framework-extensions' ) . ' - ' . esc_html__( 'Social icons', 'apollo13-framework-extensions' ), $widget_ops ); $this->alt_option_name = 'widget_a13_social_icons'; add_action( 'save_post', array( &$this, 'flush_midget_cache' ) ); add_action( 'deleted_post', array( &$this, 'flush_midget_cache' ) ); add_action( 'switch_theme', array( &$this, 'flush_midget_cache' ) ); } function widget( $args, $instance ) { $before_widget = $after_widget = $before_title = $after_title = ''; $cache = wp_cache_get( 'widget_a13_social_icons', 'widget' ); if ( ! is_array( $cache ) ) { $cache = array(); } if ( isset( $cache[ $args['widget_id'] ] ) ) { print $cache[ $args['widget_id'] ]; return; } ob_start(); extract( $args ); $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); //without theme function it is useless, as icons come from theme settings if(function_exists('apollo13framework_social_icons')){ $icons = apollo13framework_social_icons( $instance['icons_color'], $instance['icons_color_hover'] ); if ( strlen( $icons ) ) : print $before_widget; if ( $title ) { print $before_title . $title . $after_title; } print $icons; print $after_widget; endif; } $cache[ $args['widget_id'] ] = ob_get_flush(); wp_cache_set( 'widget_a13_social_icons', $cache, 'widget' ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['icons_color'] = $new_instance['icons_color']; $instance['icons_color_hover'] = $new_instance['icons_color_hover']; $this->flush_midget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset( $alloptions['widget_a13_social_icons'] ) ) { delete_option( 'widget_a13_social_icons' ); } return $instance; } function flush_midget_cache() { wp_cache_delete( 'widget_a13_social_icons', 'widget' ); } function form( $instance ) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $color = isset( $instance['icons_color'] ) ? esc_attr( $instance['icons_color'] ) : ''; $color_hover = isset( $instance['icons_color_hover'] ) ? esc_attr( $instance['icons_color_hover'] ) : ''; $options = array( 'black' => esc_html__( 'Black', 'apollo13-framework-extensions' ), 'color' => esc_html__( 'Color', 'apollo13-framework-extensions' ), 'white' => esc_html__( 'White', 'apollo13-framework-extensions' ), 'semi-transparent' => esc_html__( 'Semi transparent', 'apollo13-framework-extensions' ), ); ?>