Warning and notice fixes from Alex King. fixes #3148

git-svn-id: http://svn.automattic.com/wordpress/trunk@4198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-09-19 23:56:28 +00:00
parent ae72e8377d
commit a40292bfb4
4 changed files with 11 additions and 10 deletions

View File

@ -219,7 +219,8 @@ function wp_list_categories($args = '') {
'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '',
'hierarchical' => true, 'title_li' => __('Categories'));
$r = array_merge($defaults, $r);
$r['include_last_update_time'] = $r['show_date'];
if ( isset($r['show_date']) )
$r['include_last_update_time'] = $r['show_date'];
extract($r);
$categories = get_categories($r);

View File

@ -20,7 +20,7 @@ function &get_categories($args = '') {
parse_str($args, $r);
$defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC',
'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, $exclude => '', $include => '',
'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, 'exclude' => '', 'include' => '',
'number' => '');
$r = array_merge($defaults, $r);
if ( 'count' == $r['orderby'] )

View File

@ -388,13 +388,13 @@ class Walker {
// If flat, start and end the element and skip the level checks.
if ( $flat) {
// Start the element.
if ( $element->$id_field != 0 ) {
if ( isset($element->$id_field) && $element->$id_field != 0 ) {
$cb_args = array_merge( array($output, $element, $depth - 1), $args);
$output = call_user_func_array(array(&$this, 'start_el'), $cb_args);
}
// End the element.
if ( $element->$id_field != 0 ) {
if ( isset($element->$id_field) && $element->$id_field != 0 ) {
$cb_args = array_merge( array($output, $element, $depth - 1), $args);
$output = call_user_func_array(array(&$this, 'end_el'), $cb_args);
}
@ -583,10 +583,10 @@ class Walker_Category extends Walker {
$link .= ')';
}
if ( $show_count )
if ( isset($show_count) && $show_count )
$link .= ' ('.intval($category->category_count).')';
if ( $show_date ) {
if ( isset($show_date) && $show_date ) {
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
}

View File

@ -99,7 +99,7 @@ function &get_post(&$post, $output = OBJECT) {
}
}
if ( defined(WP_IMPORTING) )
if ( defined('WP_IMPORTING') )
unset($post_cache);
if ( $output == OBJECT ) {
@ -923,12 +923,12 @@ function &get_page(&$page, $output = OBJECT) {
wp_cache_add($page->ID, $page, 'pages');
$_page = $page;
} else {
if ( isset($GLOBALS['page']) && ($page == $GLOBALS['page']->ID) ) {
if ( isset($GLOBALS['page']->ID) && ($page == $GLOBALS['page']->ID) ) {
$_page = & $GLOBALS['page'];
wp_cache_add($_page->ID, $_page, 'pages');
} elseif ( $_page = $GLOBALS['post_cache'][$page] ) {
} elseif ( isset($_page) && $_page == $GLOBALS['post_cache'][$page] ) {
return get_post($page, $output);
} elseif ( $_page = wp_cache_get($page, 'pages') ) {
} elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) {
// Got it.
} else {
$query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1";