@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | $indent = str_repeat($t, $depth); |
| 55 | 55 | // Default class to add to the file. |
| 56 | - $classes = array( 'dropdown-menu' ); |
|
| 56 | + $classes = array('dropdown-menu'); |
|
| 57 | 57 | /** |
| 58 | 58 | * Filters the CSS class(es) applied to a menu list element. |
| 59 | 59 | * |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | // Build a string of html containing all the atts for the item. |
| 214 | 214 | $attributes = ''; |
| 215 | 215 | foreach ($atts as $attr => $value) { |
| 216 | - if (! empty($value)) { |
|
| 216 | + if ( ! empty($value)) { |
|
| 217 | 217 | $value = ('href' === $attr) ? esc_url($value) : esc_attr($value); |
| 218 | 218 | $attributes .= ' ' . $attr . '="' . $value . '"'; |
| 219 | 219 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * output inside of the item before the $title (the link text). |
| 247 | 247 | */ |
| 248 | 248 | $icon_html = ''; |
| 249 | - if (! empty($icon_class_string)) { |
|
| 249 | + if ( ! empty($icon_class_string)) { |
|
| 250 | 250 | // append an <i> with the icon classes to what is output before links. |
| 251 | 251 | $icon_html = '<i class="' . esc_attr($icon_class_string) . '" aria-hidden="true"></i> '; |
| 252 | 252 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $title = self::wrap_for_screen_reader($title); |
| 274 | 274 | $keys_to_unset = array_keys($linkmod_classes, 'sr-only'); |
| 275 | 275 | foreach ($keys_to_unset as $k) { |
| 276 | - unset($linkmod_classes[ $k ]); |
|
| 276 | + unset($linkmod_classes[$k]); |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
@@ -323,13 +323,13 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) |
| 325 | 325 | { |
| 326 | - if (! $element) { |
|
| 326 | + if ( ! $element) { |
|
| 327 | 327 | return; |
| 328 | 328 | } |
| 329 | 329 | $id_field = $this->db_fields['id']; |
| 330 | 330 | // Display this element. |
| 331 | 331 | if (is_object($args[0])) { |
| 332 | - $args[0]->has_children = ! empty($children_elements[ $element->$id_field ]); |
|
| 332 | + $args[0]->has_children = ! empty($children_elements[$element->$id_field]); |
|
| 333 | 333 | } |
| 334 | 334 | parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output); |
| 335 | 335 | } |
@@ -420,20 +420,20 @@ discard block |
||
| 420 | 420 | if (preg_match('/^disabled|^sr-only/i', $class)) { |
| 421 | 421 | // Test for .disabled or .sr-only classes. |
| 422 | 422 | $linkmod_classes[] = $class; |
| 423 | - unset($classes[ $key ]); |
|
| 423 | + unset($classes[$key]); |
|
| 424 | 424 | } elseif (preg_match('/^dropdown-header|^dropdown-divider|^dropdown-item-text/i', $class) && $depth > 0) { |
| 425 | 425 | // Test for .dropdown-header or .dropdown-divider and a |
| 426 | 426 | // depth greater than 0 - IE inside a dropdown. |
| 427 | 427 | $linkmod_classes[] = $class; |
| 428 | - unset($classes[ $key ]); |
|
| 428 | + unset($classes[$key]); |
|
| 429 | 429 | } elseif (preg_match('/^fa-(\S*)?|^fa(s|r|l|b)?(\s?)?$/i', $class)) { |
| 430 | 430 | // Font Awesome. |
| 431 | 431 | $icon_classes[] = $class; |
| 432 | - unset($classes[ $key ]); |
|
| 432 | + unset($classes[$key]); |
|
| 433 | 433 | } elseif (preg_match('/^glyphicon-(\S*)?|^glyphicon(\s?)$/i', $class)) { |
| 434 | 434 | // Glyphicons. |
| 435 | 435 | $icon_classes[] = $class; |
| 436 | - unset($classes[ $key ]); |
|
| 436 | + unset($classes[$key]); |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
@@ -455,9 +455,9 @@ discard block |
||
| 455 | 455 | { |
| 456 | 456 | $linkmod_type = ''; |
| 457 | 457 | // Loop through array of linkmod classes to handle their $atts. |
| 458 | - if (! empty($linkmod_classes)) { |
|
| 458 | + if ( ! empty($linkmod_classes)) { |
|
| 459 | 459 | foreach ($linkmod_classes as $link_class) { |
| 460 | - if (! empty($link_class)) { |
|
| 460 | + if ( ! empty($link_class)) { |
|
| 461 | 461 | |
| 462 | 462 | // check for special class types and set a flag for them. |
| 463 | 463 | if ('dropdown-header' === $link_class) { |
@@ -486,9 +486,9 @@ discard block |
||
| 486 | 486 | */ |
| 487 | 487 | private function update_atts_for_linkmod_type($atts = array(), $linkmod_classes = array()) |
| 488 | 488 | { |
| 489 | - if (! empty($linkmod_classes)) { |
|
| 489 | + if ( ! empty($linkmod_classes)) { |
|
| 490 | 490 | foreach ($linkmod_classes as $link_class) { |
| 491 | - if (! empty($link_class)) { |
|
| 491 | + if ( ! empty($link_class)) { |
|
| 492 | 492 | // update $atts with a space and the extra classname... |
| 493 | 493 | // so long as it's not a sr-only class. |
| 494 | 494 | if ('sr-only' !== $link_class) { |