lsx_wpml_nav_language_switcher_fix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * LSX functions and definitions - Bootstrap Navigation Walker.
4
 *
5
 * @package    lsx
6
 * @subpackage navigation
7
 * @category   bootstrap-navigation-walker
8
 */
9
10
if ( ! defined( 'ABSPATH' ) ) {
11
	exit;
12
}
13
14
if ( ! function_exists( 'lsx_wpml_nav_language_switcher_fix' ) ) :
15
16
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$items" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$args" missing
Loading history...
17
	 * Add in our custom classes to the menus.
18
	 *
19
	 * @package    lsx
20
	 * @subpackage navigation
21
	 * @category   bootstrap-navigation-walker
22
	 */
23
	function lsx_wpml_nav_language_switcher_fix( $items, $args ) {
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

23
	function lsx_wpml_nav_language_switcher_fix( $items, /** @scrutinizer ignore-unused */ $args ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
		$items = str_replace( 'menu-item-language-current', 'menu-item-language-current dropdown', $items );
25
		$items = str_replace( 'submenu-languages', 'submenu-languages dropdown-menu', $items );
26
		return $items;
27
	}
28
29
endif;
30
31
add_filter( 'wp_nav_menu_items', 'lsx_wpml_nav_language_switcher_fix', 10, 2 );
32