root/branches/2.1/wp-admin/edit-category-form.php

Revision 4656, 2.3 kB (checked in by markjaquith, 2 years ago)

new function for escaping within attributes: attribute_escape()

  • Property svn:eol-style set to native
Line 
1 <?php
2 if ( ! empty($cat_ID) ) {
3     $heading = __('Edit Category');
4     $submit_text = __('Edit Category &raquo;');
5     $form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
6     $action = 'editedcat';
7     $nonce_action = 'update-category_' . $cat_ID;
8     do_action('edit_category_form_pre', $category);
9 } else {
10     $heading = __('Add Category');
11     $submit_text = __('Add Category &raquo;');
12     $form = '<form name="addcat" id="addcat" method="post" action="categories.php">';
13     $action = 'addcat';
14     $nonce_action = 'add-category';
15     do_action('add_category_form_pre', $category);
16 }
17 ?>
18
19 <div class="wrap">
20 <h2><?php echo $heading ?></h2>
21 <div id="ajax-response"></div>
22 <?php echo $form ?>
23 <input type="hidden" name="action" value="<?php echo $action ?>" />
24 <input type="hidden" name="cat_ID" value="<?php echo $category->cat_ID ?>" />
25 <?php wp_nonce_field($nonce_action); ?>
26     <table class="editform" width="100%" cellspacing="2" cellpadding="5">
27         <tr>
28             <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>
29             <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->cat_name); ?>" size="40" /></td>
30         </tr>
31         <tr>
32             <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category slug:') ?></label></th>
33             <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->category_nicename); ?>" size="40" /></td>
34         </tr>
35         <tr>
36             <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th>
37             <td>       
38                   <?php wp_dropdown_categories('hide_empty=0&name=category_parent&selected=' . $category->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
39               </td>
40         </tr>
41         <tr>
42             <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th>
43             <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description); ?></textarea></td>
44         </tr>
45     </table>
46 <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
47 <?php do_action('edit_category_form', $category); ?>
48 </form>
49 </div>
50
Note: See TracBrowser for help on using the browser.