Passed
Push — master ( e51c9a...41921a )
by Chris
04:16
created

lsx_wpml_nav_language_switcher_fix()   A

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' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
11
	exit;
12
}
13
14
if ( ! function_exists( 'lsx_wpml_nav_language_switcher_fix' ) ) :
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
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
Coding Style introduced by
Expected 2 blank lines before function; 1 found
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
	}
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
28
29
endif;
30
31
add_filter( 'wp_nav_menu_items', 'lsx_wpml_nav_language_switcher_fix', 10, 2 );
32