Fix some of the notices visible with WP_DEBUG enabled.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2007-12-20 21:25:12 +00:00
parent 21d9604409
commit 1f889417e5
4 changed files with 12 additions and 6 deletions

View File

@ -4,12 +4,15 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
$defaults = array(
'show_updated' => 0, 'show_description' => 0,
'show_images' => 1, 'before' => '<li>',
'after' => '</li>', 'between' => "\n"
'after' => '</li>', 'between' => "\n",
'show_rating' => 0
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = ''; // Blank string to start with.
foreach ( (array) $bookmarks as $bookmark ) {
if ( !isset($bookmark->recently_updated) )
$bookmark->recently_updated = false;

View File

@ -527,6 +527,9 @@ class Walker_Page extends Walker {
function start_el($output, $page, $depth, $current_page, $args) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
extract($args, EXTR_SKIP);
$css_class = 'page_item page-item-'.$page->ID;
$_current_page = get_page( $current_page );
@ -646,15 +649,15 @@ class Walker_Category extends Walker {
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
}
if ( $current_category )
if ( isset($current_category) && $current_category )
$_current_category = get_category( $current_category );
if ( 'list' == $args['style'] ) {
$output .= "\t<li";
$class = 'cat-item cat-item-'.$category->term_id;
if ( $current_category && ($category->term_id == $current_category) )
if ( isset($current_category) && $current_category && ($category->term_id == $current_category) )
$class .= ' current-cat';
elseif ( $_current_category && ($category->term_id == $_current_category->parent) )
elseif ( isset($_current_category) && $_current_category && ($category->term_id == $_current_category->parent) )
$class .= ' current-cat-parent';
$output .= ' class="'.$class.'"';
$output .= ">$link\n";

View File

@ -203,7 +203,7 @@ function dynamic_sidebar($index = 1) {
$sidebars_widgets = wp_get_sidebars_widgets();
if ( empty($wp_registered_sidebars[$index]) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
if ( empty($wp_registered_sidebars[$index]) || !array_key_exists($index, $sidebars_widgets) || !is_array($sidebars_widgets[$index]) || empty($sidebars_widgets[$index]) )
return false;
$sidebar = $wp_registered_sidebars[$index];