Created
January 17, 2023 13:08
-
-
Save champsupertramp/c52c5c43d3edcc8f192e1d096620bd91 to your computer and use it in GitHub Desktop.
Ultimate Member - Reorder languages filter in Member Directory
This file contains hidden or 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
add_filter("um_member_directory_filter_select_options_sorted","um_011723_sort_languages",10,2); | |
function um_011723_sort_languages( $options, $atts ){ | |
if( "languages" == $atts['metakey'] ){ | |
$key = 'en'; | |
$value = $options[$key]; | |
unset($options[$key]); | |
array_unshift($options, $value); | |
$key = 'nl'; | |
$value = $options[$key]; | |
unset($options[$key]); | |
array_unshift($options, $value); | |
} | |
return $options; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment