Action hook 'wp_delete_nav_menu'

in WP Core File wp-includes/nav-menu.php at line 298

View Source

wp_delete_nav_menu

Action Hook
Description
Fires after a navigation menu has been successfully deleted.

Hook Information

File Location wp-includes/nav-menu.php View on GitHub
Hook Type Action
Line Number 298

Hook Parameters

Type Name Description
int $term_id ID of the deleted menu.

Usage Examples

Basic Usage
<?php
// Hook into wp_delete_nav_menu
add_action('wp_delete_nav_menu', 'my_custom_function', 10, 1);

function my_custom_function($term_id) {
    // Your custom code here
}

Source Code Context

wp-includes/nav-menu.php:298 - How this hook is used in WordPress core
<?php
 293  		 *
 294  		 * @since 3.0.0
 295  		 *
 296  		 * @param int $term_id ID of the deleted menu.
 297  		 */
 298  		do_action( 'wp_delete_nav_menu', $menu->term_id );
 299  	}
 300  
 301  	return $result;
 302  }
 303  

PHP Documentation

<?php
/**
		 * Fires after a navigation menu has been successfully deleted.
		 *
		 * @since 3.0.0
		 *
		 * @param int $term_id ID of the deleted menu.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/nav-menu.php
Related Hooks

Related hooks will be displayed here in future updates.