Make WordPress Core

Ticket #9381: 9381.001.diff

File 9381.001.diff, 3.2 KB (added by aaroncampbell, 17 years ago)
  • trunk/wp-includes/category-template.php

     
    799799}
    800800
    801801/**
     802 * Retrieve tag description.
     803 *
     804 * @since 2.8
     805 *
     806 * @param int $tag Optional. Tag ID. Will use global tag ID by default.
     807 * @return string Tag description, available.
     808 */
     809function tag_description( $tag = 0 ) {
     810        $tag_id = intval( get_query_var('tag_id') );
     811
     812        if ( !$tag )
     813                $tag = $tag_id;
     814
     815        return get_term_field( 'description', $tag, 'post_tag' );
     816}
     817
     818/**
    802819 * Retrieve the terms of the taxonomy that are attached to the post.
    803820 *
    804821 * This function can only be used within the loop.
  • trunk/wp-admin/admin-ajax.php

     
    11691169                        else
    11701170                                $taxonomy = 'post_tag';
    11711171
     1172                        $tag = get_term( $id, $taxonomy );
     1173                        $_POST['description'] = $tag->description;
     1174
    11721175                        $updated = wp_update_term($id, $taxonomy, $_POST);
    11731176                        if ( $updated && !is_wp_error($updated) ) {
    11741177                                $tag = get_term( $updated['term_id'], $taxonomy );
  • trunk/wp-admin/edit-tags.php

     
    287287        <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
    288288</div>
    289289
     290<div class="form-field">
     291        <label for="tag_description"><?php _e('Description') ?></label>
     292        <textarea name="description" id="tag_description" rows="5" cols="40"></textarea>
     293    <p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
     294</div>
     295
    290296<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
    291297<?php do_action('add_tag_form'); ?>
    292298</form></div>
  • trunk/wp-admin/edit-tag-form.php

     
    3434                        <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
    3535            <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
    3636                </tr>
     37                <tr class="form-field">
     38                        <th scope="row" valign="top"><label for="tag_description"><?php _e('Description') ?></label></th>
     39                        <td><textarea name="description" id="tag_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($tag->description); ?></textarea><br />
     40            <?php _e('The description is not prominent by default, however some themes may show it.'); ?></td>
     41                </tr>
    3742        </table>
    3843<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e('Update Tag'); ?>" /></p>
    3944<?php do_action('edit_tag_form', $tag); ?>