From d918ee0ba1458a26a5b8b5edde845fd341088b63 Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Fri, 13 Sep 2024 12:00:03 +0200 Subject: [PATCH] Version 2.5.0 --- MslsMenu.php | 10 +++++++--- readme.txt | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/MslsMenu.php b/MslsMenu.php index cb4d300..3849f68 100644 --- a/MslsMenu.php +++ b/MslsMenu.php @@ -5,7 +5,7 @@ Requires Plugins: multisite-language-switcher Plugin URI: https://github.com/lloc/MslsMenu Description: Adds the Multisite Language Switcher to the primary-nav-menu -Version: 2.4.1 +Version: 2.5.0 Author: Dennis Ploetner Author URI: http://lloc.de/ Text Domain: mslsmenu @@ -34,7 +34,7 @@ * MslsMenu Class * @package mslsmenu */ -class MslsMenu { +final class MslsMenu { /** * @var string @@ -75,6 +75,10 @@ public static function init( $options ): MslsMenu { return $obj; } + private function get_msls_output(): lloc\Msls\MslsOutput{ + return function_exists( 'msls_output' ) ? msls_output() : lloc\Msls\MslsOutput::init(); + } + /** * Callback for wp_nav_menu_items * @@ -90,7 +94,7 @@ public function nav_item( string $items, \stdClass $args ): string { if ( is_array( $menu_locations ) && in_array( $theme_location, $menu_locations ) ) { $menu = ''; - $obj = lloc\Msls\MslsOutput::init(); + $obj = $this->get_msls_output(); foreach ( $obj->get( (int) $this->options->mslsmenu_display, false, (int) $this->options->only_with_translation ) as $item ) { $menu .= $this->options->mslsmenu_before_item . $item . $this->options->mslsmenu_after_item; } diff --git a/readme.txt b/readme.txt index 6c15c19..1f708b5 100644 --- a/readme.txt +++ b/readme.txt @@ -4,9 +4,9 @@ Contributors: realloc Donate link: http://www.greenpeace.org/international/ Tags: multilingual, multisite, language, switcher, menu Requires at least: 5.3 -Tested up to: 6.5 +Tested up to: 6.6 Requires PHP: 7.4 -Stable tag: 2.4.1 +Stable tag: 2.5.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -35,6 +35,10 @@ But this can lead to fatal errors if you don't know much about PHP, or maybe the == Changelog == += 2.5.0 = +* WordPress 6.6 tested +* MslsOutput class deprecated init in favour of a function + = 2.4.1 = * readme.txt tags updated * Plugin check issues fixed