Make WordPress Core

Ticket #6671: manage_categories.patch

File manage_categories.patch, 4.0 KB (added by simonwheatley, 17 years ago)

Patch to reduce the amount of Notices generated when on manage categories screen

  • wp-admin/categories.php

    diff -urN wordpress/wp-admin/categories.php site/wp-admin/categories.php
    old new  
    126126<?php endif; ?>
    127127
    128128<p id="post-search">
    129         <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
     129        <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes( @ $_GET['s'] )); ?>" />
    130130        <input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
    131131</p>
    132132
  • wp-admin/edit-category-form.php

    diff -urN wordpress/wp-admin/edit-category-form.php site/wp-admin/edit-category-form.php
    old new  
    1212        $form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list: validate">';
    1313        $action = 'addcat';
    1414        $nonce_action = 'add-category';
     15        if ( ! isset( $category ) ) $category = null;
    1516        do_action('add_category_form_pre', $category);
    1617}
    1718?>
     
    2122<div id="ajax-response"></div>
    2223<?php echo $form ?>
    2324<input type="hidden" name="action" value="<?php echo $action ?>" />
    24 <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
     25<input type="hidden" name="cat_ID" value="<?php echo @ $category->term_id ?>" />
    2526<?php wp_nonce_field($nonce_action); ?>
    2627        <table class="form-table">
    2728                <tr class="form-field form-required">
    2829                        <th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
    29                         <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /><br />
     30                        <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape( @ $category->name ); ?>" size="40" /><br />
    3031            <?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
    3132                </tr>
    3233                <tr class="form-field">
    3334                        <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
    34                         <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->slug); ?>" size="40" /><br />
     35                        <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape( @ $category->slug ); ?>" size="40" /><br />
    3536            <?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>
    3637                </tr>
    3738                <tr class="form-field">
    3839                        <th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
    3940                        <td>
    40                                 <?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?><br />
     41                                <?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . @ $category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?><br />
    4142                <?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.'); ?>
    4243                        </td>
    4344                </tr>
    4445                <tr class="form-field">
    4546                        <th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
    46                         <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea><br />
     47                        <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars( @ $category->description); ?></textarea><br />
    4748            <?php _e('The description is not prominent by default, however some themes may show it.'); ?></td>
    4849                </tr>
    4950        </table>