Changeset 12498
- Timestamp:
- 11/29/2019 03:46:56 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-walker-nav-menu.php
r12497 r12498 12 12 13 13 /** 14 * Create HTML list of BP nav items. 14 * Compatibility Class to make BP_Walker_Nav_Menu::walk() compatible 15 * from PHP 5.3 to 5.6 and up. 15 16 * 16 * @since 1.7.017 * @since 5.1.0 17 18 */ 18 class BP_Walker_Nav_Menu extends Walker_Nav_Menu { 19 19 class BP_Walker_Nav_Menu_Compat extends Walker_Nav_Menu { 20 20 /** 21 21 * Description of fields indexes for building markup. … … 48 48 * 49 49 * @since 1.7.0 50 * @since 6.0.0 Formalized the existing `...$args` parameter by adding it51 * to the function signature to match WordPress 5.3.50 * @since 5.1.0 Method was renamed from `walk` to `do_walk` to ensure PHP 5.3 compatibility 51 * 52 52 * @see Walker::walk() 53 53 * 54 54 * @param array $elements See {@link Walker::walk()}. 55 55 * @param int $max_depth See {@link Walker::walk()}. 56 * @param mixed ...$argsOptional additional arguments.56 * @param array $args Optional additional arguments. 57 57 * @return string See {@link Walker::walk()}. 58 58 */ 59 public function walk( $elements, $max_depth, ...$args) {59 public function do_walk( $elements, $max_depth, $args = array() ) { 60 60 $output = ''; 61 61 … … 213 213 } 214 214 } 215 216 if ( PHP_VERSION_ID >= 50600 ) { 217 require_once dirname( __DIR__ ) . '/compat/php56/class-bp-compat-walker-nav-menu.php'; 218 } else { 219 require_once dirname( __DIR__ ) . '/compat/php53/class-bp-compat-walker-nav-menu.php'; 220 }
Note: See TracChangeset
for help on using the changeset viewer.