How to sort custom post's category by id from the theme's function.php?

I'm wondering how to sort a custom post's categories in the selection field which I've circled in the screenshot?

And I have the following code which generates category listing

 $args=array(
                'class'       = 'select-submit2',
                'hide_empty'  = false,
                'selected'    = $prop_category_selected,
                'name'        = 'prop_category',
                'id'          = 'prop_category_submit',
                'orderby'     = 'NAME',
                'order'       = 'ASC',
                'show_option_none'   = __('None','wpestate'),
                'taxonomy'    = 'property_category',
                'hierarchical'= true
            );
        wp_dropdown_categories( $args ); ?

Topic order functions categories custom-post-types sort Wordpress

Category Web


You need to change the orderby to ID:

            $args=array(
                'class'       => 'select-submit2',
                'hide_empty'  => false,
                'selected'    => $prop_category_selected,
                'name'        => 'prop_category',
                'id'          => 'prop_category_submit',
                'orderby'     => 'ID', //this changed to ID
                'order'       => 'ASC',
                'show_option_none'   => __('None','wpestate'),
                'taxonomy'    => 'property_category',
                'hierarchical'=> true
            );
        wp_dropdown_categories( $args ); ?>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.