Changeset 5837 for trunk/src/includes/topics/functions.php
- Timestamp:
- 07/15/2015 05:29:22 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r5829 r5837 3682 3682 * Get topic tags for a specific topic ID 3683 3683 * 3684 * @since bbPress (r5836) 3685 * 3686 * @param int $topic_id 3687 * 3688 * @return string 3689 */ 3690 function bbp_get_topic_tags( $topic_id = 0 ) { 3691 $topic_id = bbp_get_topic_id( $topic_id ); 3692 $terms = (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ); 3693 $topic_tags = array_filter( $terms ); 3694 3695 return apply_filters( 'bbp_get_topic_tags', $topic_tags, $topic_id ); 3696 } 3697 3698 /** 3699 * Get topic tags for a specific topic ID 3700 * 3684 3701 * @since bbPress (r4165) 3685 3702 * 3686 * @param int $topic_id3703 * @param int $topic_id 3687 3704 * @param string $sep 3705 * 3688 3706 * @return string 3689 3707 */ 3690 3708 function bbp_get_topic_tag_names( $topic_id = 0, $sep = ', ' ) { 3691 $topic_id = bbp_get_topic_id( $topic_id ); 3692 $topic_tags = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) ); 3693 $terms = array(); 3694 foreach ( $topic_tags as $term ) { 3695 $terms[] = $term->name; 3696 } 3697 $terms = ! empty( $terms ) ? implode( $sep, $terms ) : ''; 3698 3699 return apply_filters( 'bbp_get_topic_tags', $terms, $topic_id ); 3709 $topic_tags = bbp_get_topic_tags( $topic_id ); 3710 $pluck = wp_list_pluck( $topic_tags, 'name' ); 3711 $terms = ! empty( $pluck ) ? implode( $sep, $pluck ) : ''; 3712 3713 return apply_filters( 'bbp_get_topic_tag_names', $terms, $topic_id, $sep ); 3700 3714 } 3701 3715
Note: See TracChangeset
for help on using the changeset viewer.