` for dropdown). Default is `true` when * `layout` is `select`. Omitting this argument on a bare list call triggers * a `_doing_it_wrong()` notice: pass `show_wrapper` => false explicitly to * keep the current behavior. * @type bool $show_flags Display the flags or not. Default is `false`. * @type string $flag_aspect_ratio Flags aspect ratio. Possible values are `3:2` and `1:1`. Default is `3:2`. * @type string $show_labels Display the labels. Possible values are an empty string (no labels), * `names` (language names), `codes` (languages codes). Default is `names`. * @type bool $hide_if_empty Hide languages that don't have any posts. Default is `true`. * @type bool $hide_if_no_translation Hide languages that don't have translations. Default is `false`. * @type bool $hide_current Hide the current language. Default is `false`. * @type bool $force_home Force elements to link to the home pages instead of the translations. * Default is `false`. * @type int $post_id Build the links according to the translations of the given post ID. * Default is `0`. * @type string[] $wrapper_classes HTML classes to add to the wrapper. Default is an empty array. * @type string[] $item_classes HTML classes to add to each item. Default is an empty array. * @type string[] $link_classes HTML classes to add to each link. Default is an empty array. * @type string $unique_id A unique identifier. Default is an empty string: a default unique * identifier will be automatically generated. * @type bool $echo Whether to print the HTML markup or return it. Default is `true`. * @type bool $raw Whether to return a raw array instead of HTML markup. Default is `false`. * } * @return string|array|void Either the html markup of the switcher or the raw elements to build a custom language switcher. */ function pll_the_languages( $args = array() ) { if ( empty( PLL()->links ) ) { return empty( $args['raw'] ) ? '' : array(); } if ( Settings::is_legacy( $args ) ) { _deprecated_argument( 'pll_the_languages()', '3.9', 'See the documentation of pll_the_languages()' ); } if ( empty( $args['raw'] ) && ! isset( $args['show_wrapper'] ) ) { if ( ! isset( $args['layout'] ) ) { // Backward compatibility with Polylang < 3.9. $args['show_wrapper'] = false; if ( empty( $args['dropdown'] ) ) { _doing_it_wrong( 'pll_the_languages()', 'pll_the_languages() does not output a wrapper by default. Pass `show_wrapper` => false explicitly to keep this behavior. In a near future, pll_the_languages() will output a `