Created
September 8, 2025 07:45
-
-
Save propertyhive/d82bdf69981e4d44388cd80256c6f8c2 to your computer and use it in GitHub Desktop.
Order property type taxonomy dropdown by most popular
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( 'propertyhive_form_taxonomy_terms_args', 'custom_property_type_order', 10, 2 ); | |
function custom_property_type_order($args, $field) | |
{ | |
if ( $field['type'] == 'property_type' ) | |
{ | |
$args['orderby'] = 'count'; | |
$args['order'] = 'DESC'; | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment