nav_menu_attr_title
Filter HookDescription
Get the value emulated into a WP_Post and set up as a nav_menu_item.Hook Information
File Location |
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
View on GitHub
|
Hook Type | Filter |
Line Number | 637 |
Hook Parameters
This hook doesn't accept any parameters.
Usage Examples
Basic Usage
<?php
// Hook into nav_menu_attr_title
add_filter('nav_menu_attr_title', 'my_custom_filter');
function my_custom_filter() {
// Your custom filtering logic here
return 'modified_value';
}
Source Code Context
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:637
- How this hook is used in WordPress core
<?php
632 if ( is_wp_error( $post->url ) ) {
633 $post->url = '';
634 }
635
636 /** This filter is documented in wp-includes/nav-menu.php */
637 $post->attr_title = apply_filters( 'nav_menu_attr_title', $post->attr_title );
638
639 /** This filter is documented in wp-includes/nav-menu.php */
640 $post->description = apply_filters( 'nav_menu_description', wp_trim_words( $post->description, 200 ) );
641
642 /** This filter is documented in wp-includes/nav-menu.php */
PHP Documentation
<?php
/**
* Get the value emulated into a WP_Post and set up as a nav_menu_item.
*
* @since 4.3.0
*
* @return WP_Post With wp_setup_nav_menu_item() applied.
*/
Quick Info
- Hook Type: Filter
- Parameters: 0
- File: wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
Related Hooks
Related hooks will be displayed here in future updates.