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:
parent
21d9604409
commit
1f889417e5
|
@ -4,12 +4,15 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'show_updated' => 0, 'show_description' => 0,
|
'show_updated' => 0, 'show_description' => 0,
|
||||||
'show_images' => 1, 'before' => '<li>',
|
'show_images' => 1, 'before' => '<li>',
|
||||||
'after' => '</li>', 'between' => "\n"
|
'after' => '</li>', 'between' => "\n",
|
||||||
|
'show_rating' => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
extract( $r, EXTR_SKIP );
|
extract( $r, EXTR_SKIP );
|
||||||
|
|
||||||
|
$output = ''; // Blank string to start with.
|
||||||
|
|
||||||
foreach ( (array) $bookmarks as $bookmark ) {
|
foreach ( (array) $bookmarks as $bookmark ) {
|
||||||
if ( !isset($bookmark->recently_updated) )
|
if ( !isset($bookmark->recently_updated) )
|
||||||
$bookmark->recently_updated = false;
|
$bookmark->recently_updated = false;
|
||||||
|
|
|
@ -20,7 +20,7 @@ function redirect_canonical($requested_url=NULL, $do_redirect=true) {
|
||||||
|
|
||||||
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
|
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
|
||||||
$original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
|
$original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
|
||||||
|
|
||||||
$redirect = $original;
|
$redirect = $original;
|
||||||
$redirect_url = false;
|
$redirect_url = false;
|
||||||
|
|
||||||
|
|
|
@ -527,6 +527,9 @@ class Walker_Page extends Walker {
|
||||||
function start_el($output, $page, $depth, $current_page, $args) {
|
function start_el($output, $page, $depth, $current_page, $args) {
|
||||||
if ( $depth )
|
if ( $depth )
|
||||||
$indent = str_repeat("\t", $depth);
|
$indent = str_repeat("\t", $depth);
|
||||||
|
else
|
||||||
|
$indent = '';
|
||||||
|
|
||||||
extract($args, EXTR_SKIP);
|
extract($args, EXTR_SKIP);
|
||||||
$css_class = 'page_item page-item-'.$page->ID;
|
$css_class = 'page_item page-item-'.$page->ID;
|
||||||
$_current_page = get_page( $current_page );
|
$_current_page = get_page( $current_page );
|
||||||
|
@ -646,15 +649,15 @@ class Walker_Category extends Walker {
|
||||||
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
|
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $current_category )
|
if ( isset($current_category) && $current_category )
|
||||||
$_current_category = get_category( $current_category );
|
$_current_category = get_category( $current_category );
|
||||||
|
|
||||||
if ( 'list' == $args['style'] ) {
|
if ( 'list' == $args['style'] ) {
|
||||||
$output .= "\t<li";
|
$output .= "\t<li";
|
||||||
$class = 'cat-item cat-item-'.$category->term_id;
|
$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';
|
$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';
|
$class .= ' current-cat-parent';
|
||||||
$output .= ' class="'.$class.'"';
|
$output .= ' class="'.$class.'"';
|
||||||
$output .= ">$link\n";
|
$output .= ">$link\n";
|
||||||
|
|
|
@ -203,7 +203,7 @@ function dynamic_sidebar($index = 1) {
|
||||||
|
|
||||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
$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;
|
return false;
|
||||||
|
|
||||||
$sidebar = $wp_registered_sidebars[$index];
|
$sidebar = $wp_registered_sidebars[$index];
|
||||||
|
|
Loading…
Reference in New Issue