get only sub category ID
As you only want a select form field that has a categories children, then simply go with wp_list_categories() wp_list_categories( array( ‘child_of’ => ‘your parent cat ID’, ) ); Depending on your use case, you could as well use get_the_category() and its get_the_categories filter apply_filters( ‘get_the_categories’, $categories ); get_the_terms() and its filter (the function is called … Read more