Ticket #9381: 9381.002.diff
| File 9381.002.diff, 4.7 KB (added by aaroncampbell, 3 years ago) |
|---|
-
trunk/wp-includes/category-template.php
293 293 * @return string Category description, available. 294 294 */ 295 295 function category_description( $category = 0 ) { 296 global $cat; 297 if ( !$category ) 298 $category = $cat; 299 300 return get_term_field( 'description', $category, 'category' ); 296 return term_description( $category, 'category' ); 301 297 } 302 298 303 299 /** … … 799 795 } 800 796 801 797 /** 798 * Retrieve tag description. 799 * 800 * @since 2.9 801 * 802 * @param int $tag Optional. Tag ID. Will use global tag ID by default. 803 * @return string Tag description, available. 804 */ 805 function tag_description( $tag = 0 ) { 806 return term_description( $tag ); 807 } 808 809 /** 810 * Retrieve term description. 811 * 812 * @since 2.9 813 * 814 * @param int $term Optional. Term ID. Will use global term ID by default. 815 * @return string Term description, available. 816 */ 817 function term_description( $term = 0, $taxonomy = 'post_tag' ) { 818 if ( !$term && ( is_tax() || is_tag() || is_category() ) ) { 819 global $wp_query; 820 $term = $wp_query->get_queried_object(); 821 $taxonomy = $term->taxonomy; 822 $term = $term->term_id; 823 } 824 return get_term_field( 'description', $term, $taxonomy ); 825 } 826 827 /** 802 828 * Retrieve the terms of the taxonomy that are attached to the post. 803 829 * 804 830 * This function can only be used within the loop. -
trunk/wp-admin/admin-ajax.php
1169 1169 else 1170 1170 $taxonomy = 'post_tag'; 1171 1171 1172 $tag = get_term( $id, $taxonomy ); 1173 $_POST['description'] = $tag->description; 1174 1172 1175 $updated = wp_update_term($id, $taxonomy, $_POST); 1173 1176 if ( $updated && !is_wp_error($updated) ) { 1174 1177 $tag = get_term( $updated['term_id'], $taxonomy ); -
trunk/wp-admin/includes/template.php
668 668 $out .= '<div class="name">' . $qe_data->name . '</div>'; 669 669 $out .= '<div class="slug">' . $qe_data->slug . '</div></div></td>'; 670 670 break; 671 case 'description': 672 $out .= "<td $attributes>$tag->description</td>"; 673 break; 671 674 case 'slug': 672 675 $out .= "<td $attributes>$tag->slug</td>"; 673 676 break; … … 872 875 $_wp_column_headers[$page] = array( 873 876 'cb' => '<input type="checkbox" />', 874 877 'name' => __('Name'), 878 'description' => __('Description'), 875 879 'slug' => __('Slug'), 876 880 'posts' => __('Posts') 877 881 ); -
trunk/wp-admin/edit-tags.php
287 287 <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p> 288 288 </div> 289 289 290 <div class="form-field"> 291 <label for="description"><?php _e('Description') ?></label> 292 <textarea name="description" id="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 290 296 <p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p> 291 297 <?php do_action('add_tag_form'); ?> 292 298 </form></div> -
trunk/wp-admin/edit-tag-form.php
34 34 <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" /> 35 35 <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td> 36 36 </tr> 37 <tr class="form-field"> 38 <th scope="row" valign="top"><label for="description"><?php _e('Description') ?></label></th> 39 <td><textarea name="description" id="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> 37 42 </table> 38 43 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e('Update Tag'); ?>" /></p> 39 44 <?php do_action('edit_tag_form', $tag); ?>
