"get_the_term_list" category IDs

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:

		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

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?

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

select them where though?

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

Is that something you can help with?

Hello?

Wondering if this is a valid request.

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.

Thanks Gareth, done.