| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * Displays a language list |
| 8 | 5 | * |
| @@ -56,31 +53,13 @@ | ||
| 56 | 53 | /** |
| 57 | 54 | * Overrides Walker:walk to set depth argument |
| 58 | 55 | * |
| 59 | 56 | * @since 1.2 |
| 60 | - * @since 2.6.7 Use $max_depth and ...$args parameters to follow the move of WP 5.3 | |
| 61 | 57 | * |
| 62 | - * @param array $elements An array of elements. | |
| 63 | - * @param int $max_depth The maximum hierarchical depth. | |
| 64 | - * @param mixed ...$args Additional arguments. | |
| 65 | - * @return string The hierarchical item output. | |
| 58 | + * @param array $elements elements to display | |
| 59 | + * @param array $args | |
| 60 | + * @return string | |
| 66 | 61 | */ |
| 67 | - public function walk( $elements, $max_depth, ...$args ) { // phpcs:ignore WordPressVIPMinimum.Classes.DeclarationCompatibility.DeclarationCompatibility | |
| 68 | - if ( is_array( $max_depth ) ) { | |
| 69 | - // Backward compatibility with Polylang < 2.6.7 | |
| 70 | - if ( WP_DEBUG ) { | |
| 71 | - trigger_error( // phpcs:ignore WordPress.PHP.DevelopmentFunctions | |
| 72 | - sprintf( | |
| 73 | - '%s was called incorrectly. The method expects an integer as second parameter since Polylang 2.6.7', | |
| 74 | - __METHOD__ | |
| 75 | - ) | |
| 76 | - ); | |
| 77 | - } | |
| 78 | - $args = $max_depth; | |
| 79 | - $max_depth = -1; | |
| 80 | - } else { | |
| 81 | - $args = isset( $args[0] ) ? $args[0] : array(); | |
| 82 | - } | |
| 83 | - | |
| 84 | - return parent::walk( $elements, $max_depth, $args ); | |
| 62 | + public function walk( $elements, $args = array() ) { | |
| 63 | + return parent::walk( $elements, -1, $args ); | |
| 85 | 64 | } |
| 86 | 65 | } |