wppaste
WordPress

Walker_Nav_Menu_Edit

Since
3.0.0
Source
wp-admin/includes/class-walker-nav-menu-edit.php:17
Create HTML list of nav menu input items.

Compatibility

WordPress
since 3.0.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside Walker_Nav_Menu_Edit, in the order it appears in the class, grouped by the method that fires it.

Methods · 3

Source code

class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {	/**	 * Starts the list before the elements are added.	 *	 * @see Walker_Nav_Menu::start_lvl()	 *	 * @since 3.0.0	 *	 * @param string   $output Passed by reference.	 * @param int      $depth  Depth of menu item. Used for padding.	 * @param stdClass $args   Not used.	 */	public function start_lvl( &$output, $depth = 0, $args = null ) {} 	/**	 * Ends the list of after the elements are added.	 *	 * @see Walker_Nav_Menu::end_lvl()	 *	 * @since 3.0.0	 *	 * @param string   $output Passed by reference.	 * @param int      $depth  Depth of menu item. Used for padding.	 * @param stdClass $args   Not used.	 */	public function end_lvl( &$output, $depth = 0, $args = null ) {} 	/**	 * Start the element output.	 *	 * @see Walker_Nav_Menu::start_el()	 * @since 3.0.0	 * @since 5.9.0 Renamed `$item` to `$data_object` and `$id` to `$current_object_id`	 *              to match parent class for PHP 8 named parameter support.	 *	 * @global int $_wp_nav_menu_max_depth The maximum depth of the nav menu.	 *	 * @param string   $output            Used to append additional content (passed by reference).	 * @param WP_Post  $data_object       Menu item data object.	 * @param int      $depth             Depth of menu item. Used for padding.	 * @param stdClass $args              Not used.	 * @param int      $current_object_id Optional. ID of the current menu item. Default 0.	 */	public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ) {		global $_wp_nav_menu_max_depth; 		// Restores the more descriptive, specific name for use within this method.		$menu_item = $data_object; 		$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; 		ob_start();		$item_id      = esc_attr( $menu_item->ID );		$removed_args = array(			'action',			'customlink-tab',			'edit-menu-item',			'menu-item',			'page-tab',			'_wpnonce',		); 		$original_title = false; 		if ( 'taxonomy' === $menu_item->type ) {			$original_object = get_term( (int) $menu_item->object_id, $menu_item->object );			if ( $original_object && ! is_wp_error( $original_object ) ) {				$original_title = $original_object->name;			}		} elseif ( 'post_type' === $menu_item->type ) {			$original_object = get_post( $menu_item->object_id );			if ( $original_object ) {				$original_title = get_the_title( $original_object->ID );			}		} elseif ( 'post_type_archive' === $menu_item->type ) {			$original_object = get_post_type_object( $menu_item->object );			if ( $original_object ) {				$original_title = $original_object->labels->archives;			}		}

Changelog

Introduced in 3.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-admin/includes/class-walker-nav-menu-edit.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.