Last active
December 16, 2015 19:19
-
-
Save joshdcomp/5484581 to your computer and use it in GitHub Desktop.
Utility snippet for a group of accordions parsing an array to determine the classnames the accordion container should receive.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$parentString = ''; | |
$parentString .= ( $menu['is_current'] ) | |
? 'is_current ' | |
: ''; | |
$parentString .= empty( $subMenu ) | |
? '' | |
: 'is_parent '; | |
$parentString .= ( $menu['is_current'] || !empty($isParent) ) | |
? 'open' | |
: ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first revision was dirty and stupid (as I thought), so I refactored it to this