| [ Index ] |
PHP Cross Reference of zeList |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Edit link category form for inclusion in administration panels. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 8 9 /** 10 * @var object 11 */ 12 if ( ! isset( $category ) ) 13 $category = (object) array(); 14 15 if ( ! empty($cat_ID) ) { 16 /** 17 * @var string 18 */ 19 $heading = '<h2>' . __('Edit Link Category') . '</h2>'; 20 $submit_text = __('Update Category'); 21 $form = '<form name="editcat" id="editcat" method="post" action="'.ZELIST_ADMIN_URL_CATEGORY.'&noheader=1" class="validate">'; 22 $action = 'editedcat'; 23 $nonce_action = 'update-link-category_' . $cat_ID; 24 do_action('edit_link_category_form_pre', $category); 25 } else { 26 $heading = '<h2>' . __('Add Link Category') . '</h2>'; 27 $submit_text = __('Add Category'); 28 $form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="'.ZELIST_ADMIN_URL_CATEGORY.'&noheader=1">'; 29 $action = 'addcat'; 30 $nonce_action = 'add-link-category'; 31 do_action('add_link_category_form_pre', $category); 32 } 33 34 /** 35 * @ignore 36 * @since 2.7 37 * @internal Used to prevent errors in page when no category is being edited. 38 * 39 * @param object $category 40 */ 41 function _fill_empty_link_category(&$category) { 42 if ( ! isset( $category->name ) ) 43 $category->name = ''; 44 45 if ( ! isset( $category->slug ) ) 46 $category->slug = ''; 47 48 if ( ! isset( $category->description ) ) 49 $category->description = ''; 50 } 51 52 _fill_empty_link_category($category); 53 ?> 54 55 <div class="wrap"> 56 <?php screen_icon(); ?> 57 <?php echo $heading ?> 58 <div id="ajax-response"></div> 59 <?php echo $form ?> 60 <input type="hidden" name="action" value="<?php echo $action ?>" /> 61 <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" /> 62 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?> 63 <table class="form-table"> 64 <tr class="form-field form-required"> 65 <th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th> 66 <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td> 67 </tr> 68 <tr class="form-field"> 69 <th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th> 70 <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br /> 71 <?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td> 72 </tr> 73 <tr class="form-field"> 74 <th scope="row" valign="top"><label for="parent"><?php _e('Category Parent') ?></label></th> 75 <td> 76 <?php wp_dropdown_categories(array('type' => 'link', 'exclude' => $category->term_id, 'hide_empty' => 0, 'name' => 'parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br /> 77 <?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.'); ?> 78 </td> 79 </tr> 80 81 <tr class="form-field"> 82 <th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th> 83 <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td> 84 </tr> 85 </table> 86 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo $submit_text ?>" /></p> 87 <?php do_action('edit_link_category_form', $category); ?> 88 </form> 89 </div>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sat May 30 23:51:06 2009 | Cross-referenced by PHPXref 0.7 |