Fix E_STRICT notices in walkers. props dvarga. see #24356.

git-svn-id: http://core.svn.wordpress.org/trunk@24377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-05-28 03:29:15 +00:00
parent c5033c96f5
commit 4b13a1ffa4
6 changed files with 12 additions and 13 deletions

View File

@ -14,7 +14,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* *
* @param string $output Passed by reference. * @param string $output Passed by reference.
*/ */
function start_lvl(&$output) {} function start_lvl( &$output, $depth = 0, $args = array() ) {}
/** /**
* @see Walker_Nav_Menu::end_lvl() * @see Walker_Nav_Menu::end_lvl()
@ -22,8 +22,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* *
* @param string $output Passed by reference. * @param string $output Passed by reference.
*/ */
function end_lvl(&$output) { function end_lvl( &$output, $depth = 0, $args = array() ) {}
}
/** /**
* @see Walker::start_el() * @see Walker::start_el()
@ -34,7 +33,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
* @param int $depth Depth of menu item. Used for padding. * @param int $depth Depth of menu item. Used for padding.
* @param object $args * @param object $args
*/ */
function start_el(&$output, $item, $depth, $args) { function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $_wp_nav_menu_max_depth; global $_wp_nav_menu_max_depth;
$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
@ -231,12 +230,12 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
} }
} }
function start_lvl( &$output, $depth ) { function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth ); $indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class='children'>\n"; $output .= "\n$indent<ul class='children'>\n";
} }
function end_lvl( &$output, $depth ) { function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth ); $indent = str_repeat( "\t", $depth );
$output .= "\n$indent</ul>"; $output .= "\n$indent</ul>";
} }
@ -250,7 +249,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
* @param int $depth Depth of menu item. Used for padding. * @param int $depth Depth of menu item. Used for padding.
* @param object $args * @param object $args
*/ */
function start_el(&$output, $item, $depth, $args) { function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $_nav_menu_placeholder; global $_nav_menu_placeholder;
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;

View File

@ -34,7 +34,7 @@ class Walker_Category_Checklist extends Walker {
$output .= "$indent</ul>\n"; $output .= "$indent</ul>\n";
} }
function start_el( &$output, $category, $depth, $args, $id = 0 ) { function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
extract($args); extract($args);
if ( empty($taxonomy) ) if ( empty($taxonomy) )
$taxonomy = 'category'; $taxonomy = 'category';

View File

@ -933,7 +933,7 @@ class Walker_CategoryDropdown extends Walker {
* @param int $depth Depth of category. Used for padding. * @param int $depth Depth of category. Used for padding.
* @param array $args Uses 'selected' and 'show_count' keys, if they exist. * @param array $args Uses 'selected' and 'show_count' keys, if they exist.
*/ */
function start_el( &$output, $category, $depth, $args, $id = 0 ) { function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
$pad = str_repeat('&nbsp;', $depth * 3); $pad = str_repeat('&nbsp;', $depth * 3);
$cat_name = apply_filters('list_cats', $category->name, $category); $cat_name = apply_filters('list_cats', $category->name, $category);

View File

@ -80,7 +80,7 @@ class Walker {
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
*/ */
function start_el( &$output, $object, $depth, $args, $current_object_id = 0 ) {} function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
/** /**
* Ends the element output, if needed. * Ends the element output, if needed.

View File

@ -1325,7 +1325,7 @@ class Walker_Comment extends Walker {
* @param int $depth Depth of comment in reference to parents. * @param int $depth Depth of comment in reference to parents.
* @param array $args * @param array $args
*/ */
function start_el( &$output, $comment, $depth, $args, $id = 0 ) { function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) {
$depth++; $depth++;
$GLOBALS['comment_depth'] = $depth; $GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment; $GLOBALS['comment'] = $comment;

View File

@ -1053,7 +1053,7 @@ class Walker_Page extends Walker {
* @param int $current_page Page ID. * @param int $current_page Page ID.
* @param array $args * @param array $args
*/ */
function start_el( &$output, $page, $depth, $args, $current_page = 0 ) { function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
if ( $depth ) if ( $depth )
$indent = str_repeat("\t", $depth); $indent = str_repeat("\t", $depth);
else else
@ -1135,7 +1135,7 @@ class Walker_PageDropdown extends Walker {
* @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element. * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
* @param int $id * @param int $id
*/ */
function start_el(&$output, $page, $depth, $args, $id = 0) { function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
$pad = str_repeat('&nbsp;', $depth * 3); $pad = str_repeat('&nbsp;', $depth * 3);
$output .= "\t<option class=\"level-$depth\" value=\"$page->ID\""; $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";