Skip to:
Content

bbPress.org

Changeset 5310


Ignore:
Timestamp:
03/05/2014 07:08:27 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Allow topic-tag descriptions to be edited theme-side. Props netweb. Fixes #1613.

Location:
trunk/src
Files:
4 edited

Legend:

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

    r5223 r5310  
    18351835
    18361836            // Attempt to update the tag
    1837             $slug = !empty( $_POST['tag-slug'] ) ? $_POST['tag-slug'] : '';
    1838             $tag  = wp_update_term( $tag_id, bbp_get_topic_tag_tax_id(), array( 'name' => $name, 'slug' => $slug ) );
     1837            $slug        = !empty( $_POST['tag-slug']        ) ? $_POST['tag-slug']        : '';
     1838            $description = !empty( $_POST['tag-description'] ) ? $_POST['tag-description'] : '';
     1839            $tag         = wp_update_term( $tag_id, bbp_get_topic_tag_tax_id(), array( 'name' => $name, 'slug' => $slug, 'description' => $description ) );
    18391840
    18401841            // Cannot update tag
     
    18481849
    18491850            // Update counts, etc...
    1850             do_action( 'bbp_update_topic_tag', $tag_id, $tag, $name, $slug );
     1851            do_action( 'bbp_update_topic_tag', $tag_id, $tag, $name, $slug, $description );
    18511852
    18521853            break;
  • trunk/src/templates/default/bbpress/content-archive-topic.php

    r4971 r5310  
    2424    <?php bbp_breadcrumb(); ?>
    2525
    26     <?php if ( bbp_is_topic_tag() ) bbp_topic_tag_description(); ?>
     26    <?php do_action( 'bbp_template_before_topic_tag_description' ); ?>
     27
     28    <?php if ( bbp_is_topic_tag() ) : ?>
     29
     30        <?php bbp_topic_tag_description( array( 'before' => '<div class="bbp-template-notice info"><p>', 'after' => '</p></div>' ) ); ?>
     31
     32    <?php endif; ?>
     33
     34    <?php do_action( 'bbp_template_after_topic_tag_description' ); ?>
    2735
    2836    <?php do_action( 'bbp_template_before_topics_index' ); ?>
  • trunk/src/templates/default/bbpress/content-topic-tag-edit.php

    r4733 r5310  
    1414    <?php bbp_breadcrumb(); ?>
    1515
    16     <?php bbp_topic_tag_description(); ?>
     16    <?php do_action( 'bbp_template_before_topic_tag_description' ); ?>
     17
     18    <?php bbp_topic_tag_description( array( 'before' => '<div class="bbp-template-notice info"><p>', 'after' => '</p></div>' ) ); ?>
     19
     20    <?php do_action( 'bbp_template_after_topic_tag_description' ); ?>
    1721
    1822    <?php do_action( 'bbp_template_before_topic_tag_edit' ); ?>
  • trunk/src/templates/default/bbpress/form-topic-tag.php

    r4733 r5310  
    4040                        <label for="tag-slug"><?php _e( 'Slug:', 'bbpress' ); ?></label>
    4141                        <input type="text" id="tag-slug" name="tag-slug" size="20" maxlength="40" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( apply_filters( 'editable_slug', bbp_get_topic_tag_slug() ) ); ?>" />
     42                    </div>
     43
     44                    <div>
     45                        <label for="tag-description"><?php _e( 'Description:', 'bbpress' ); ?></label>
     46                        <input type="text" id="tag-description" name="tag-description" size="20" tabindex="<?php bbp_tab_index(); ?>" value="<?php echo esc_attr( bbp_get_topic_tag_description( array( 'before' => '', 'after' => '' ) ) ); ?>" />
    4247                    </div>
    4348
Note: See TracChangeset for help on using the changeset viewer.