X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..refs/tags/wordpress-2.9:/wp-admin/edit-category-form.php diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index 60368c2f..53c60b57 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -1,53 +1,83 @@ '; - $action = 'editedcat'; - $nonce_action = 'update-category_' . $cat_ID; - do_action('edit_category_form_pre', $category); -} else { - $heading = __('Add Category'); - $submit_text = __('Add Category'); - $form = '
'; - $action = 'addcat'; - $nonce_action = 'add-category'; - do_action('add_category_form_pre', $category); +/** + * Edit category form for inclusion in administration panels. + * + * @package WordPress + * @subpackage Administration + */ + +// don't load directly +if ( !defined('ABSPATH') ) + die('-1'); + +if ( !current_user_can('manage_categories') ) + wp_die(__('You do not have sufficient permissions to edit categories for this blog.')); + +/** + * @var object + */ +if ( ! isset( $category ) ) + $category = (object) array(); + +/** + * @ignore + * @since 2.7 + * @internal Used to prevent errors in page when no category is being edited. + * + * @param object $category + */ +function _fill_empty_category(&$category) { + if ( ! isset( $category->name ) ) + $category->name = ''; + + if ( ! isset( $category->slug ) ) + $category->slug = ''; + + if ( ! isset( $category->parent ) ) + $category->parent = ''; + + if ( ! isset( $category->description ) ) + $category->description = ''; } + +do_action('edit_category_form_pre', $category); + +_fill_empty_category($category); ?>
-

+ +

- - - - + + + + - + - + - + +

-


-

+
- parent . '&hierarchical=1&show_option_none=' . __('None')); ?>
- + 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
+

-

+
-

+