raw
mp-wp_genesis           1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Edit link category form for inclusion in administration panels.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 /**
mp-wp_genesis 10 * @var object
mp-wp_genesis 11 */
mp-wp_genesis 12 if ( ! isset( $category ) )
mp-wp_genesis 13 $category = (object) array();
mp-wp_genesis 14
mp-wp_genesis 15 if ( ! empty($cat_ID) ) {
mp-wp_genesis 16 /**
mp-wp_genesis 17 * @var string
mp-wp_genesis 18 */
mp-wp_genesis 19 $heading = '<h2>' . __('Edit Link Category') . '</h2>';
mp-wp_genesis 20 $submit_text = __('Update Category');
mp-wp_genesis 21 $form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
mp-wp_genesis 22 $action = 'editedcat';
mp-wp_genesis 23 $nonce_action = 'update-link-category_' . $cat_ID;
mp-wp_genesis 24 do_action('edit_link_category_form_pre', $category);
mp-wp_genesis 25 } else {
mp-wp_genesis 26 $heading = '<h2>' . __('Add Link Category') . '</h2>';
mp-wp_genesis 27 $submit_text = __('Add Category');
mp-wp_genesis 28 $form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
mp-wp_genesis 29 $action = 'addcat';
mp-wp_genesis 30 $nonce_action = 'add-link-category';
mp-wp_genesis 31 do_action('add_link_category_form_pre', $category);
mp-wp_genesis 32 }
mp-wp_genesis 33
mp-wp_genesis 34 /**
mp-wp_genesis 35 * @ignore
mp-wp_genesis 36 * @since 2.7
mp-wp_genesis 37 * @internal Used to prevent errors in page when no category is being edited.
mp-wp_genesis 38 *
mp-wp_genesis 39 * @param object $category
mp-wp_genesis 40 */
mp-wp_genesis 41 function _fill_empty_link_category(&$category) {
mp-wp_genesis 42 if ( ! isset( $category->name ) )
mp-wp_genesis 43 $category->name = '';
mp-wp_genesis 44
mp-wp_genesis 45 if ( ! isset( $category->slug ) )
mp-wp_genesis 46 $category->slug = '';
mp-wp_genesis 47
mp-wp_genesis 48 if ( ! isset( $category->description ) )
mp-wp_genesis 49 $category->description = '';
mp-wp_genesis 50 }
mp-wp_genesis 51
mp-wp_genesis 52 _fill_empty_link_category($category);
mp-wp_genesis 53 ?>
mp-wp_genesis 54
mp-wp_genesis 55 <div class="wrap">
mp-wp_genesis 56 <?php screen_icon(); ?>
mp-wp_genesis 57 <?php echo $heading ?>
mp-wp_genesis 58 <?php echo $form ?>
mp-wp_genesis 59 <input type="hidden" name="action" value="<?php echo $action ?>" />
mp-wp_genesis 60 <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
mp-wp_genesis 61 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
mp-wp_genesis 62 <table class="form-table">
mp-wp_genesis 63 <tr class="form-field form-required">
mp-wp_genesis 64 <th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
mp-wp_genesis 65 <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
mp-wp_genesis 66 </tr>
mp-wp_genesis 67 <tr class="form-field">
mp-wp_genesis 68 <th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
mp-wp_genesis 69 <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
mp-wp_genesis 70 <?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.'); ?></td>
mp-wp_genesis 71 </tr>
mp-wp_genesis 72 <tr class="form-field">
mp-wp_genesis 73 <th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
mp-wp_genesis 74 <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
mp-wp_genesis 75 </tr>
mp-wp_genesis 76 </table>
mp-wp_genesis 77 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo $submit_text ?>" /></p>
mp-wp_genesis 78 <?php do_action('edit_link_category_form', $category); ?>
mp-wp_genesis 79 </form>
mp-wp_genesis 80 </div>