__( 'A collection of social platforms', 'blogcast' ) ] ); } public function widget( $args, $instance ) { extract( $args ); $widget_title = isset( $instance['widget_title'] ) ? $instance['widget_title'] : ''; $icon_inherit_color = isset( $instance['icon_inherit_color'] ) ? $instance['icon_inherit_color'] : ''; echo wp_kses_post( $before_widget ); if( ! empty( $widget_title ) ) echo $before_title . $widget_title . $after_title; ?>
'widget_title', 'type' => 'text', 'title' => esc_html__( 'Widget Title', 'blogcast' ), 'description' => esc_html__( 'Add the widget title here', 'blogcast' ), 'default' => esc_html__( 'Find Me On', 'blogcast' ) ], [ 'name' => 'icon_inherit_color', 'type' => 'checkbox', 'title' => esc_html__( 'Inherit global default social icons color', 'blogcast' ), 'default' => true ] ]; } public function form( $instance ) { $widget_fields = $this->widget_fields(); foreach( $widget_fields as $widget_field ) : if( isset( $instance[ $widget_field['name'] ] ) ) : $field_value = $instance[ $widget_field['name'] ]; elseif( isset( $widget_field['default'] ) ) : $field_value = $widget_field['default']; else: $field_value = ''; endif; blogcast_widget_fields( $this, $widget_field, $field_value ); endforeach; ?> widget_fields(); if( ! is_array( $widget_fields ) ) return; foreach( $widget_fields as $widget_field ) : $instance[ $widget_field['name'] ] = blogcast_sanitize_widget_fields( $widget_field, $new_instance ); endforeach; return $instance; } }