/
home
/
techb158
/
dev.aleamaralawal.com
/
wp-content
/
plugins
/
polylang
/
src
/
/home/techb158/dev.aleamaralawal.com/wp-content/plugins/polylang/src
mkdir
upload
Name
Size
Mode
Actions
admin/
-
0755
rm
Capabilities/
-
0755
rm
frontend/
-
0755
rm
install/
-
0755
rm
integrations/
-
0755
rm
Model/
-
0755
rm
modules/
-
0755
rm
Options/
-
0755
rm
settings/
-
0755
rm
api.php
22291
0644
edit
dl
rm
base.php
6259
0644
edit
dl
rm
cache.php
2454
0644
edit
dl
rm
class-polylang.php
8537
0644
edit
dl
rm
constant-functions.php
1853
0644
edit
dl
rm
cookie.php
3104
0644
edit
dl
rm
crud-posts.php
13129
0644
edit
dl
rm
crud-terms.php
8962
0644
edit
dl
rm
default-term.php
6595
0644
edit
dl
rm
filter-rest-routes.php
5100
0644
edit
dl
rm
filters-links.php
5780
0644
edit
dl
rm
filters-sanitization.php
3311
0644
edit
dl
rm
filters-widgets-options.php
2697
0644
edit
dl
rm
filters.php
13248
0644
edit
dl
rm
format-util.php
3114
0644
edit
dl
rm
functions.php
5264
0644
edit
dl
rm
language-deprecated.php
7296
0644
edit
dl
rm
language-factory.php
9630
0644
edit
dl
rm
language.php
18327
0644
edit
dl
rm
license.php
9620
0644
edit
dl
rm
links-abstract-domain.php
3240
0644
edit
dl
rm
links-default.php
3100
0644
edit
dl
rm
links-directory.php
9726
0644
edit
dl
rm
links-domain.php
2980
0644
edit
dl
rm
links-model.php
6678
0644
edit
dl
rm
links-permalinks.php
5753
0644
edit
dl
rm
links-subdomain.php
2209
0644
edit
dl
rm
links.php
1415
0644
edit
dl
rm
mo.php
3504
0644
edit
dl
rm
model.php
23508
0644
edit
dl
rm
nav-menu.php
4609
0644
edit
dl
rm
olt-manager.php
3056
0644
edit
dl
rm
query.php
7913
0644
edit
dl
rm
rest-request.php
4325
0644
edit
dl
rm
static-pages.php
6418
0644
edit
dl
rm
switcher.php
11237
0644
edit
dl
rm
term-slug.php
5012
0644
edit
dl
rm
translatable-object-with-types-interface.php
1055
0644
edit
dl
rm
translatable-object-with-types-trait.php
2005
0644
edit
dl
rm
translatable-object.php
18042
0644
edit
dl
rm
translatable-objects.php
3799
0644
edit
dl
rm
translate-option.php
13417
0644
edit
dl
rm
translated-object.php
19388
0644
edit
dl
rm
translated-post.php
17586
0644
edit
dl
rm
translated-term.php
15171
0644
edit
dl
rm
walker-dropdown.php
3857
0644
edit
dl
rm
walker-list.php
2602
0644
edit
dl
rm
walker.php
2434
0644
edit
dl
rm
widget-calendar.php
11858
0644
edit
dl
rm
widget-languages.php
5466
0644
edit
dl
rm
Edit:
/home/techb158/dev.aleamaralawal.com/wp-content/plugins/polylang/src/widget-languages.php
(5466B)
<?php /** * @package Polylang */ /** * The language switcher widget * * @since 0.1 * * @extends WP_Widget<T> * @phpstan-template T of array{ * title: string, * dropdown: 0|1, * show_names: 0|1, * show_flags: 0|1, * force_home: 0|1, * hide_current: 0|1, * hide_if_no_translation: 0|1 * } */ class PLL_Widget_Languages extends WP_Widget { /** * Constructor * * @since 0.1 */ public function __construct() { parent::__construct( 'polylang', __( 'Language switcher', 'polylang' ), array( 'description' => __( 'Displays a language switcher', 'polylang' ), 'customize_selective_refresh' => true, ) ); } /** * Displays the widget * * @since 0.1 * * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget * @return void * * @phpstan-param array{ * name: string, * id: string, * description: string, * class: string, * before_widget: string, * after_widget: string, * before_title: string, * after_title: string, * before_sidebar: string, * after_sidebar: string, * show_in_rest: boolean, * widget_id: string, * widget_name: string * } $args * @phpstan-param T $instance */ public function widget( $args, $instance ) { // Sets a unique id for dropdown. $instance['dropdown'] = empty( $instance['dropdown'] ) ? 0 : $this->id; $instance['echo'] = 0; $instance['raw'] = 0; $list = pll_the_languages( $instance ); if ( $list ) { $title = empty( $instance['title'] ) ? '' : $instance['title']; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput } // The title may be filtered: Strip out HTML and make sure the aria-label is never empty. $aria_label = trim( wp_strip_all_tags( $title ) ); if ( ! $aria_label ) { $aria_label = __( 'Choose a language', 'polylang' ); } if ( $instance['dropdown'] ) { echo '<label class="screen-reader-text" for="' . esc_attr( 'lang_choice_' . $instance['dropdown'] ) . '">' . esc_html( $aria_label ) . '</label>'; echo $list; // phpcs:ignore WordPress.Security.EscapeOutput } else { $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; /** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */ $format = apply_filters( 'navigation_widgets_format', $format ); if ( 'html5' === $format ) { echo '<nav aria-label="' . esc_attr( $aria_label ) . '">'; } echo "<ul>\n" . $list . "</ul>\n"; // phpcs:ignore WordPress.Security.EscapeOutput if ( 'html5' === $format ) { echo '</nav>'; } } echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput } } /** * Updates the widget options * * @since 0.4 * * @param array $new_instance New settings for this instance as input by the user via form() * @param array $old_instance Old settings for this instance * @return array Settings to save or bool false to cancel saving * * @phpstan-param T $new_instance * @phpstan-param T $old_instance */ public function update( $new_instance, $old_instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable $instance = array( 'title' => sanitize_text_field( $new_instance['title'] ) ); foreach ( array_keys( PLL_Switcher::get_switcher_options( 'widget' ) ) as $key ) { $instance[ $key ] = ! empty( $new_instance[ $key ] ) ? 1 : 0; } return $instance; } /** * Displays the widget form. * * @since 0.4 * * @param array $instance Current settings. * @return string * * @phpstan-param T $instance */ public function form( $instance ) { // Default values $instance = wp_parse_args( (array) $instance, array_merge( array( 'title' => '' ), PLL_Switcher::get_switcher_options( 'widget', 'default' ) ) ); // Title printf( '<p><label for="%1$s">%2$s</label><input class="widefat" id="%1$s" name="%3$s" type="text" value="%4$s" /></p>', esc_attr( $this->get_field_id( 'title' ) ), esc_html__( 'Title:', 'polylang' ), esc_attr( $this->get_field_name( 'title' ) ), esc_attr( $instance['title'] ) ); foreach ( PLL_Switcher::get_switcher_options( 'widget' ) as $key => $str ) { printf( '<div%5$s%6$s><input type="checkbox" class="checkbox %7$s" id="%1$s" name="%2$s"%3$s /><label for="%1$s">%4$s</label></div>', esc_attr( $this->get_field_id( $key ) ), esc_attr( $this->get_field_name( $key ) ), checked( $instance[ $key ], true, false ), esc_html( $str ), in_array( $key, array( 'show_names', 'show_flags', 'hide_current' ) ) ? sprintf( ' class="no-dropdown-%s"', esc_attr( $this->id ) ) : '', ( ! empty( $instance['dropdown'] ) && in_array( $key, array( 'show_names', 'show_flags', 'hide_current' ) ) ? ' style="display:none;"' : '' ), esc_attr( 'pll-' . $key ) ); } return ''; // Because the parent class returns a string, however not used. } }
Save
cmd:
run