default_settings = apply_filters( 'powerkit_widget_contributors_settings', array( 'title' => esc_html__( 'Contributors', 'powerkit' ), 'filter_ids' => '', 'avatar' => true, 'social_accounts' => true, ) ); $widget_details = array( 'classname' => 'powerkit_widget_contributors', 'description' => '', ); parent::__construct( 'powerkit_widget_contributors', esc_html__( 'Contributors', 'powerkit' ), $widget_details ); } /** * Outputs the content for the current widget instance. * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current widget instance. */ public function widget( $args, $instance ) { $params = array_merge( $this->default_settings, $instance ); // Title. if ( $params['title'] ) { $params['title'] = apply_filters( 'widget_title', $params['title'], $instance, $this->id_base ); } powerkit_contributors_get_html( $params, $args ); } /** * Handles updating settings for the current widget instance. * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Settings to save or bool false to cancel saving. */ public function update( $new_instance, $old_instance ) { $instance = $new_instance; // Display avatar. if ( ! isset( $instance['avatar'] ) ) { $instance['avatar'] = false; } // Display social accounts. if ( ! isset( $instance['social_accounts'] ) ) { $instance['social_accounts'] = false; } return $instance; } /** * Outputs the widget settings form. * * @param array $instance Current settings. */ public function form( $instance ) { $params = array_merge( $this->default_settings, $instance ); ?>
/>
/>