Make WordPress Core


Ignore:
Timestamp:
09/21/2008 08:41:25 PM (17 years ago)
Author:
westi
Message:

Notice fixes see #7509 props DD32 and jacobsantos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-category-form.php

    r8656 r8944  
    66 * @subpackage Administration
    77 */
     8
     9/**
     10 * @var object
     11 */
     12if ( ! isset( $category ) )
     13    $category = (object) array();
    814
    915if ( ! empty($cat_ID) ) {
     
    2531    do_action('add_category_form_pre', $category);
    2632}
     33
     34/**
     35 * @ignore
     36 * @since 2.7
     37 * @internal Used to prevent errors in page when no category is being edited.
     38 *
     39 * @param object $category
     40 */
     41function _fill_empty_category(&$category) {
     42    if ( ! isset( $category->name ) )
     43        $category->name = '';
     44
     45    if ( ! isset( $category->slug ) )
     46        $category->slug = '';
     47
     48    if ( ! isset( $category->parent ) )
     49        $category->parent = '';
     50
     51    if ( ! isset( $category->description ) )
     52        $category->description = '';
     53}
     54
     55_fill_empty_category($category);
    2756?>
    2857
Note: See TracChangeset for help on using the changeset viewer.