Skip to content

Commit d918ee0

Browse files
committed
Version 2.5.0
1 parent e16c4f4 commit d918ee0

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

MslsMenu.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Requires Plugins: multisite-language-switcher
66
Plugin URI: https://github.com/lloc/MslsMenu
77
Description: Adds the Multisite Language Switcher to the primary-nav-menu
8-
Version: 2.4.1
8+
Version: 2.5.0
99
Author: Dennis Ploetner
1010
Author URI: http://lloc.de/
1111
Text Domain: mslsmenu
@@ -34,7 +34,7 @@
3434
* MslsMenu Class
3535
* @package mslsmenu
3636
*/
37-
class MslsMenu {
37+
final class MslsMenu {
3838

3939
/**
4040
* @var string
@@ -75,6 +75,10 @@ public static function init( $options ): MslsMenu {
7575
return $obj;
7676
}
7777

78+
private function get_msls_output(): lloc\Msls\MslsOutput{
79+
return function_exists( 'msls_output' ) ? msls_output() : lloc\Msls\MslsOutput::init();
80+
}
81+
7882
/**
7983
* Callback for wp_nav_menu_items
8084
*
@@ -90,7 +94,7 @@ public function nav_item( string $items, \stdClass $args ): string {
9094
if ( is_array( $menu_locations ) && in_array( $theme_location, $menu_locations ) ) {
9195
$menu = '';
9296

93-
$obj = lloc\Msls\MslsOutput::init();
97+
$obj = $this->get_msls_output();
9498
foreach ( $obj->get( (int) $this->options->mslsmenu_display, false, (int) $this->options->only_with_translation ) as $item ) {
9599
$menu .= $this->options->mslsmenu_before_item . $item . $this->options->mslsmenu_after_item;
96100
}

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Contributors: realloc
44
Donate link: http://www.greenpeace.org/international/
55
Tags: multilingual, multisite, language, switcher, menu
66
Requires at least: 5.3
7-
Tested up to: 6.5
7+
Tested up to: 6.6
88
Requires PHP: 7.4
9-
Stable tag: 2.4.1
9+
Stable tag: 2.5.0
1010
License: GPLv2 or later
1111
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1212

@@ -35,6 +35,10 @@ But this can lead to fatal errors if you don't know much about PHP, or maybe the
3535

3636
== Changelog ==
3737

38+
= 2.5.0 =
39+
* WordPress 6.6 tested
40+
* MslsOutput class deprecated init in favour of a function
41+
3842
= 2.4.1 =
3943
* readme.txt tags updated
4044
* Plugin check issues fixed

0 commit comments

Comments
 (0)