From a40292bfb4020f33ccbc5cb3a636ce61f668cb4e Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 19 Sep 2006 23:56:28 +0000 Subject: [PATCH] Warning and notice fixes from Alex King. fixes #3148 git-svn-id: http://svn.automattic.com/wordpress/trunk@4198 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 3 ++- wp-includes/category.php | 2 +- wp-includes/classes.php | 8 ++++---- wp-includes/post.php | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 346fbb6329..c6d1e45223 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -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); diff --git a/wp-includes/category.php b/wp-includes/category.php index 6ffb2100c3..76382ad095 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -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'] ) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index e7dd8bc18a..ad4fe12001 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -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); } diff --git a/wp-includes/post.php b/wp-includes/post.php index fa747aa42a..468ed37376 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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";