# "get\_the\_term\_list" category IDs

**URL:** <https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394>\
**Category:** Developers\
**Created:** [December 15, 2021, 8:28am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394 "2021-12-15T08:28:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [December 15, 2021, 8:28am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/1 "2021-12-15T08:28:29Z")

</div>

Hi. I’d like to copy the Post Grid module into a new module that accepts the Category ID instead of the Category Name as an input.

The reason I’d like to do this is that some of our custom post type subcategories have the same subcategory name as subcategories of different parent categories.

In /bb-plugin/modules/post-grid/post-grid.php on page 333 is the function public function get\_post\_terms().

In this function is:

```auto
		foreach ( $taxonomies as $name => $tax ) {
			if ( ! $tax->hierarchical ) {
				continue;
			}

			$term_list = get_the_term_list( get_the_ID(), $name, '', $terms_separator, '' );
			if ( ! empty( $term_list ) ) {
				$terms_list[] = $term_list;
			}
		}

		if ( count( $terms_list ) > 0 ) {
			return join( $terms_separator, $terms_list );
		}

```

Is this the code I need to edit in my child theme’s /mobules/… to get/return the category IDs?

Thanks,  
Steve

---

<div class="post-metadata">

**Author:** ![pross](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/pross/32/883_2.png) [@pross](https://community.wpbeaverbuilder.com/u/pross)\
**Post date:** [December 15, 2021, 4:10pm UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/2 "2021-12-15T16:10:17Z")

</div>

The function you have highlighted is used to display the taxonomies in the post grid meta, like the tags of a post, categories etc.

What are you trying to do here?

---

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [December 16, 2021, 2:22am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/3 "2021-12-16T02:22:52Z")

</div>

Replace any category names with category IDs, so we can select to display the post grid by category ID rather than category name.

---

<div class="post-metadata">

**Author:** ![pross](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/pross/32/883_2.png) [@pross](https://community.wpbeaverbuilder.com/u/pross)\
**Post date:** [December 16, 2021, 3:37pm UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/4 "2021-12-16T15:37:39Z")

</div>

select them where though?

---

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [December 17, 2021, 1:02am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/5 "2021-12-17T01:02:01Z")

</div>

When editing the post grid. Instead of selecting the category name, I’d like to select a category ID.

---

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [January 5, 2022, 1:44am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/6 "2022-01-05T01:44:47Z")

</div>

Is that something you can help with?

---

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [May 12, 2022, 4:43am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/7 "2022-05-12T04:43:34Z")

</div>

Hello?

Wondering if this is a valid request.

---

<div class="post-metadata">

**Author:** ![Gareth](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/gareth/32/898_2.png) [@Gareth](https://community.wpbeaverbuilder.com/u/Gareth)\
**Post date:** [May 12, 2022, 5:15am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/8 "2022-05-12T05:15:08Z")

</div>

You should add it to the feature requests in Github. I think it would be seen by more people there.

[GitHub - beaverbuilder/feature-requests: Feature request board for Beaver Builder products.](https://github.com/beaverbuilder/feature-requests)

---

<div class="post-metadata">

**Author:** ![MMD](https://community.wpbeaverbuilder.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@MMD](https://community.wpbeaverbuilder.com/u/MMD)\
**Post date:** [May 12, 2022, 7:44am UTC](https://community.wpbeaverbuilder.com/t/get-the-term-list-category-ids/15394/9 "2022-05-12T07:44:34Z")

</div>

Thanks Gareth, [done](https://github.com/beaverbuilder/feature-requests/issues/245).
