Hello,
I am sorry that I am not clear about your issue.
But you can get only parent taxonomy or child taxonomy by using https://developer.ww.wp.xz.cn/reference/functions/get_terms/
$terms = get_terms( array(
'taxonomy' => 'tax_name',
'parent' => 0
) );
Thank you
Thanks a lot, I mean I have a parent ubication and one child ubication and it is required to write in both, but I only want to be required the parent ubication not the child.
Basically, I want to be as required one main location but not a sub-location, for instance if I choose a required State, but not necessarily I need to select a city. In addition, when I search in the cities of the state the ad will be available because the state is the main Ubication.
State-Main Ubication(1) –> Required
–City Ubication (2) —> Not required
However, the Ad published in the sate is available to see in the cities when I am looking.
Thanks, sorry for my english I expect that you understand me.
Hello,
Sorry state, city is required field. But if you don’t set any child if the city then only state work. Need to customize code to remove required.
Hi,
I am making this topic resolved. If need create new topic.
Thanks