Changeset 10903
- Timestamp:
- 04/09/2009 04:00:40 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
wp-admin/admin-ajax.php (modified) (1 diff)
-
wp-admin/edit-tag-form.php (modified) (1 diff)
-
wp-admin/edit-tags.php (modified) (1 diff)
-
wp-admin/includes/template.php (modified) (2 diffs)
-
wp-includes/category-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r10872 r10903 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) ) { -
trunk/wp-admin/edit-tag-form.php
r10239 r10903 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> -
trunk/wp-admin/edit-tags.php
r10775 r10903 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'); ?> -
trunk/wp-admin/includes/template.php
r10893 r10903 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>"; … … 873 876 'cb' => '<input type="checkbox" />', 874 877 'name' => __('Name'), 878 'description' => __('Description'), 875 879 'slug' => __('Slug'), 876 880 'posts' => __('Posts') -
trunk/wp-includes/category-template.php
r10888 r10903 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 … … 800 796 801 797 /** 798 * Retrieve tag description. 799 * 800 * @since 2.8 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.8 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 *
Note: See TracChangeset
for help on using the changeset viewer.