Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 06:18:28 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Moderation: Fix some copy-pasta and make sure form terms are formatted correctly. See #459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/template.php

    r5835 r5841  
    24062406            // If terms exist, implode them and compile the return value
    24072407            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'];
    24102409            }
    24112410
     
    24162415
    24172416        // No terms so return none string
    2418         if ( empty( $terms ) ) {
     2417        if ( ! empty( $terms ) ) {
     2418            $retval = $terms;
     2419        } else {
    24192420            $retval = $r['none'];
    24202421        }
     
    39603961    function bbp_get_form_topic_tags() {
    39613962
     3963        // Default return value
     3964        $topic_tags = '';
     3965
    39623966        // Get _POST data
    39633967        if ( ( bbp_is_topic_form_post_request() || bbp_is_reply_form_post_request() ) && isset( $_POST['bbp_topic_tags'] ) ) {
     
    39723976                // Post is a topic
    39733977                case bbp_get_topic_post_type() :
    3974                     $topic_id = get_the_ID();
     3978                    $topic_id = bbp_get_topic_id( get_the_ID() );
    39753979                    break;
    39763980
     
    39883992
    39893993                    // 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 ) : '';
    39963996
    39973997                // Topic is not spam so get real terms
    39983998                } 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 );
    40054000                }
    4006 
    4007             // Define local variable(s)
    4008             } else {
    4009                 $new_terms = '';
    40104001            }
    4011 
    4012             // Set the return value
    4013             $topic_tags = ( ! empty( $new_terms ) ) ? implode( ', ', $new_terms ) : '';
    4014 
    4015         // No data
    4016         } else {
    4017             $topic_tags = '';
    40184002        }
    40194003
Note: See TracChangeset for help on using the changeset viewer.