X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8a06f4f9392d1ac373442f82ee40428a3cb81395..449d082fcc4873c1f7d363a0d9f7409be7f6e77d:/wp-admin/edit-category-form.php diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index f32cfd4f..d84f30f9 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -1,28 +1,51 @@ '; - $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 + */ + +/** + * @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); ?>
-

+ +

- - + + - + @@ -47,7 +70,7 @@ if ( ! empty($cat_ID) ) {
-

+