Skip to content

Commit

Permalink
Version 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Sep 13, 2024
1 parent e16c4f4 commit d918ee0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions MslsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -34,7 +34,7 @@
* MslsMenu Class
* @package mslsmenu
*/
class MslsMenu {
final class MslsMenu {

/**
* @var string
Expand Down Expand Up @@ -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
*
Expand All @@ -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;
}
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d918ee0

Please sign in to comment.