args(); if ( $args && count( Switcher::languages() ) > 1 ) { Switcher::enqueue( $args['style'] ); } } /** * Prints the switcher when the Switcher screen asks for it. */ public function render(): void { $args = $this->args(); if ( ! $args ) { return; } echo wp_kses( Switcher::render( $args ), Switcher::allowedHtml() ); } /** * Returns the style and class of the switcher, as the Switcher screen sets it. * * @return array{place: string, style: string, class: string}|null Null when the screen does not ask for it. */ private function args(): ?array { $footer = Settings::get()['footer']; if ( ! $footer['enabled'] ) { return null; } $floating = 'end' !== $footer['position']; // A list floating in a corner would cover the page; there it opens as a dropdown. return array( 'place' => 'footer', 'style' => $floating && 'dropdown' !== $footer['style'] ? 'dropdown' : $footer['style'], 'class' => 'is-footer' . ( $floating ? ' is-floating is-' . $footer['position'] : '' ), ); } }