golden hour
/home/godaofbq/zenearth.com/wp-content/plugins/polylang/include
⬆️ Go Up
Upload
File/Folder
Size
Actions
api.php
17.35 KB
Del
OK
base.php
5.79 KB
Del
OK
cache.php
2.44 KB
Del
OK
class-polylang.php
8.55 KB
Del
OK
cookie.php
3.35 KB
Del
OK
crud-posts.php
15.15 KB
Del
OK
crud-terms.php
9.87 KB
Del
OK
db-tools.php
1.01 KB
Del
OK
filter-rest-routes.php
4.87 KB
Del
OK
filters-links.php
5.55 KB
Del
OK
filters-sanitization.php
3.23 KB
Del
OK
filters-widgets-options.php
2.57 KB
Del
OK
filters.php
15.38 KB
Del
OK
functions.php
7 KB
Del
OK
language-deprecated.php
7.18 KB
Del
OK
language-factory.php
9.31 KB
Del
OK
language.php
18.04 KB
Del
OK
license.php
9.19 KB
Del
OK
links-abstract-domain.php
3.16 KB
Del
OK
links-default.php
3.03 KB
Del
OK
links-directory.php
9.49 KB
Del
OK
links-domain.php
3.06 KB
Del
OK
links-model.php
6.48 KB
Del
OK
links-permalinks.php
5.62 KB
Del
OK
links-subdomain.php
2.16 KB
Del
OK
links.php
1.3 KB
Del
OK
mo.php
1.97 KB
Del
OK
model.php
33.84 KB
Del
OK
nav-menu.php
4.43 KB
Del
OK
olt-manager.php
8.37 KB
Del
OK
query.php
6.39 KB
Del
OK
rest-request.php
3.12 KB
Del
OK
static-pages.php
6.26 KB
Del
OK
switcher.php
10.89 KB
Del
OK
translatable-object-with-types-interface.php
1.1 KB
Del
OK
translatable-object-with-types-trait.php
1.89 KB
Del
OK
translatable-object.php
13.27 KB
Del
OK
translatable-objects.php
3.49 KB
Del
OK
translate-option.php
12.46 KB
Del
OK
translated-object.php
16.39 KB
Del
OK
translated-post.php
11.88 KB
Del
OK
translated-term.php
9.77 KB
Del
OK
walker-dropdown.php
3.46 KB
Del
OK
walker-list.php
2.25 KB
Del
OK
walker.php
2.28 KB
Del
OK
widget-calendar.php
9.44 KB
Del
OK
widget-languages.php
4.57 KB
Del
OK
Edit: widget-languages.php
<?php /** * @package Polylang */ /** * The language switcher widget * * @since 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 */ 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 */ 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 */ 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