Skip to main content
added 188 characters in body
Source Link
Eric Holmes
  • 3.9k
  • 2
  • 22
  • 35

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion , as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

Edit: As I mentioned in my comment, get_category_by_path is much less efficient, since it gets multiple terms,. and then compares the hierarchical path. get_term_by is much better.

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion , as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion , as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

Edit: As I mentioned in my comment, get_category_by_path is much less efficient, since it gets multiple terms,. and then compares the hierarchical path. get_term_by is much better.

added 8 characters in body
Source Link
Eric Holmes
  • 3.9k
  • 2
  • 22
  • 35

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion, as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category, as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion, as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion , as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.

Source Link
Eric Holmes
  • 3.9k
  • 2
  • 22
  • 35

You're doing it correct @its_me. The latter, get_term_by() would be the best way, In my opinion, as I believe get_category_by_path uses get_term_by, just prepopulating the taxonomy to be category.