Changeset 5841
- Timestamp:
- 07/15/2015 06:18:28 PM (9 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r5837 r5841 1734 1734 */ 1735 1735 function bbp_get_forum_mod_names( $forum_id = 0, $sep = ', ' ) { 1736 $forum_mods = bbp_get_ topic_tags( $forum_id );1736 $forum_mods = bbp_get_forum_mods( $forum_id ); 1737 1737 $pluck = wp_list_pluck( $forum_mods, 'name' ); 1738 1738 $terms = ! empty( $pluck ) ? implode( $sep, $pluck ) : ''; -
trunk/src/includes/forums/template.php
r5838 r5841 492 492 } elseif ( bbp_is_single_forum() || bbp_is_forum_edit() ) { 493 493 494 $forum_id = get_the_ID(); 494 // Get the forum ID 495 $forum_id = bbp_get_forum_id( get_the_ID() ); 495 496 496 497 // Forum exists 497 498 if ( ! empty( $forum_id ) ) { 498 $new_terms = bbp_get_forum_mod_names( $forum_id ); 499 500 // Define local variable(s) 501 } else { 502 $new_terms = ''; 499 $forum_mods = bbp_get_forum_mod_names( $forum_id ); 503 500 } 504 505 // Set the return value506 $forum_mods = ( ! empty( $new_terms ) ) ? implode( ', ', $new_terms ) : '';507 501 508 502 // No data -
trunk/src/includes/topics/template.php
r5835 r5841 2406 2406 // If terms exist, implode them and compile the return value 2407 2407 if ( ! empty( $terms ) ) { 2408 $terms = implode( $r['sep'], $terms ); 2409 $retval = $r['before'] . $terms . $r['after']; 2408 $terms = $r['before'] . implode( $r['sep'], $terms ) . $r['after']; 2410 2409 } 2411 2410 … … 2416 2415 2417 2416 // No terms so return none string 2418 if ( empty( $terms ) ) { 2417 if ( ! empty( $terms ) ) { 2418 $retval = $terms; 2419 } else { 2419 2420 $retval = $r['none']; 2420 2421 } … … 3960 3961 function bbp_get_form_topic_tags() { 3961 3962 3963 // Default return value 3964 $topic_tags = ''; 3965 3962 3966 // Get _POST data 3963 3967 if ( ( bbp_is_topic_form_post_request() || bbp_is_reply_form_post_request() ) && isset( $_POST['bbp_topic_tags'] ) ) { … … 3972 3976 // Post is a topic 3973 3977 case bbp_get_topic_post_type() : 3974 $topic_id = get_the_ID();3978 $topic_id = bbp_get_topic_id( get_the_ID() ); 3975 3979 break; 3976 3980 … … 3988 3992 3989 3993 // Get pre-spam terms 3990 $new_terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true ); 3991 3992 // If terms exist, explode them and compile the return value 3993 if ( empty( $new_terms ) ) { 3994 $new_terms = ''; 3995 } 3994 $spam_terms = get_post_meta( $topic_id, '_bbp_spam_topic_tags', true ); 3995 $topic_tags = ( ! empty( $spam_terms ) ) ? implode( ', ', $spam_terms ) : ''; 3996 3996 3997 3997 // Topic is not spam so get real terms 3998 3998 } else { 3999 $terms = array_filter( (array) get_the_terms( $topic_id, bbp_get_topic_tag_tax_id() ) ); 4000 4001 // Loop through them 4002 foreach ( $terms as $term ) { 4003 $new_terms[] = $term->name; 4004 } 3999 $topic_tags = bbp_get_topic_tag_names( $topic_id ); 4005 4000 } 4006 4007 // Define local variable(s)4008 } else {4009 $new_terms = '';4010 4001 } 4011 4012 // Set the return value4013 $topic_tags = ( ! empty( $new_terms ) ) ? implode( ', ', $new_terms ) : '';4014 4015 // No data4016 } else {4017 $topic_tags = '';4018 4002 } 4019 4003
Note: See TracChangeset
for help on using the changeset viewer.