-
+ 1BD18B31925FF819DA41679FF77F2842CE3FB97F4B05050EA494CE59372B9AA6CCBCDE9BAD3F4A4F299965AFD45CD6B2AABB1229B6AC6EAD9E291FD8DDCF08AF
mp-wp/wp-admin/edit-link-category-form.php
(0 . 0)(1 . 81)
11299 <?php
11300 /**
11301 * Edit link category form for inclusion in administration panels.
11302 *
11303 * @package WordPress
11304 * @subpackage Administration
11305 */
11306
11307 /**
11308 * @var object
11309 */
11310 if ( ! isset( $category ) )
11311 $category = (object) array();
11312
11313 if ( ! empty($cat_ID) ) {
11314 /**
11315 * @var string
11316 */
11317 $heading = '<h2>' . __('Edit Link Category') . '</h2>';
11318 $submit_text = __('Update Category');
11319 $form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
11320 $action = 'editedcat';
11321 $nonce_action = 'update-link-category_' . $cat_ID;
11322 do_action('edit_link_category_form_pre', $category);
11323 } else {
11324 $heading = '<h2>' . __('Add Link Category') . '</h2>';
11325 $submit_text = __('Add Category');
11326 $form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
11327 $action = 'addcat';
11328 $nonce_action = 'add-link-category';
11329 do_action('add_link_category_form_pre', $category);
11330 }
11331
11332 /**
11333 * @ignore
11334 * @since 2.7
11335 * @internal Used to prevent errors in page when no category is being edited.
11336 *
11337 * @param object $category
11338 */
11339 function _fill_empty_link_category(&$category) {
11340 if ( ! isset( $category->name ) )
11341 $category->name = '';
11342
11343 if ( ! isset( $category->slug ) )
11344 $category->slug = '';
11345
11346 if ( ! isset( $category->description ) )
11347 $category->description = '';
11348 }
11349
11350 _fill_empty_link_category($category);
11351 ?>
11352
11353 <div class="wrap">
11354 <?php screen_icon(); ?>
11355 <?php echo $heading ?>
11356 <div id="ajax-response"></div>
11357 <?php echo $form ?>
11358 <input type="hidden" name="action" value="<?php echo $action ?>" />
11359 <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
11360 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
11361 <table class="form-table">
11362 <tr class="form-field form-required">
11363 <th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
11364 <td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
11365 </tr>
11366 <tr class="form-field">
11367 <th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
11368 <td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
11369 <?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>
11370 </tr>
11371 <tr class="form-field">
11372 <th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
11373 <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
11374 </tr>
11375 </table>
11376 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo $submit_text ?>" /></p>
11377 <?php do_action('edit_link_category_form', $category); ?>
11378 </form>
11379 </div>