| [ Root ] [ Search ] [ Index ] |
PHP Cross Reference of WordPress MU 2.9.2Provided by Yoast |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Edit category form for inclusion in administration panels. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 // don't load directly 10 if ( !defined('ABSPATH') ) 11 die('-1'); 12 13 if ( !current_user_can('manage_categories') ) 14 wp_die(__('You do not have sufficient permissions to edit categories for this blog.')); 15 16 /** 17 * @var object 18 */ 19 if ( ! isset( $category ) ) 20 $category = (object) array(); 21 22 /** 23 * @ignore 24 * @since 2.7 25 * @internal Used to prevent errors in page when no category is being edited. 26 * 27 * @param object $category 28 */ 29 function _fill_empty_category(&$category) { 30 if ( ! isset( $category->name ) ) 31 $category->name = ''; 32 33 if ( ! isset( $category->slug ) ) 34 $category->slug = ''; 35 36 if ( ! isset( $category->parent ) ) 37 $category->parent = ''; 38 39 if ( ! isset( $category->description ) ) 40 $category->description = ''; 41 } 42 43 do_action('edit_category_form_pre', $category); 44 45 _fill_empty_category($category); 46 ?> 47 48 <div class="wrap"> 49 <?php screen_icon(); ?> 50 <h2><?php _e('Edit Category'); ?></h2> 51 <div id="ajax-response"></div> 52 <form name="editcat" id="editcat" method="post" action="categories.php" class="validate"> 53 <input type="hidden" name="action" value="editedcat" /> 54 <input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" /> 55 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-category_' . $cat_ID); ?> 56 <table class="form-table"> 57 <tr class="form-field form-required"> 58 <th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th> 59 <td><input name="cat_name" id="cat_name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td> 60 </tr> 61 <tr class="form-field"> 62 <th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th> 63 <td> 64 <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br /> 65 <span class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></span> 66 </td> 67 </tr> 68 <tr class="form-field"> 69 <th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th> 70 <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($category->description); ?></textarea><br /> 71 <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td> 72 </tr> 73 <?php do_action('edit_category_form_fields', $category); ?> 74 </table> 75 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Category'); ?>" /></p> 76 <?php do_action('edit_category_form', $category); ?> 77 </form> 78 </div>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon May 3 12:25:32 2010 | Cross-referenced by PHPXref 0.7 |