__( 'Lets visitors pick a language.', 'langferry' ) ) ); } public function widget( $args, $instance ) { $html = Switcher::render( empty( $instance['style'] ) ? array() : array( 'style' => $instance['style'] ) ); if ( '' === $html ) { return; } // The theme's wrappers are HTML; wp_kses_post() keeps ordinary wrappers and removes scripts. echo wp_kses_post( $args['before_widget'] ?? '' ); $title = apply_filters( 'widget_title', $instance['title'] ?? '', $instance, $this->id_base ); if ( $title ) { echo wp_kses_post( $args['before_title'] ?? '' ) . esc_html( $title ) . wp_kses_post( $args['after_title'] ?? '' ); } echo wp_kses( $html, Switcher::allowed_html() ); echo wp_kses_post( $args['after_widget'] ?? '' ); } public function form( $instance ) { $title = $instance['title'] ?? ''; $style = $instance['style'] ?? ''; ?>
sanitize_text_field( $new_instance['title'] ?? '' ), 'style' => in_array( $new_instance['style'] ?? '', Settings::SWITCHER_STYLES, true ) ? $new_instance['style'] : '', ); } }