Filter hook 'excerpt_save_pre'

in WP Core File wp-includes/customize/class-wp-customize-nav-menu-item-setting.php at line 722

View Source

excerpt_save_pre

Filter Hook
Description
Sanitize an input. Note that parent::sanitize() erroneously does wp_unslash() on $value, but we remove that in this override. Otherwise the sanitized value.

Hook Information

File Location wp-includes/customize/class-wp-customize-nav-menu-item-setting.php View on GitHub
Hook Type Filter
Line Number 722

Hook Parameters

Type Name Description
array $value The menu item value to sanitize.

Usage Examples

Basic Usage
<?php
// Hook into excerpt_save_pre
add_filter('excerpt_save_pre', 'my_custom_filter', 10, 1);

function my_custom_filter($value) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:722 - How this hook is used in WordPress core
<?php
 717  
 718  		/** This filter is documented in wp-includes/post.php */
 719  		$menu_item_value['title'] = wp_unslash( apply_filters( 'title_save_pre', wp_slash( $menu_item_value['title'] ) ) );
 720  
 721  		/** This filter is documented in wp-includes/post.php */
 722  		$menu_item_value['attr_title'] = wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $menu_item_value['attr_title'] ) ) );
 723  
 724  		/** This filter is documented in wp-includes/post.php */
 725  		$menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) );
 726  
 727  		if ( '' !== $menu_item_value['url'] ) {

PHP Documentation

<?php
/**
	 * Sanitize an input.
	 *
	 * Note that parent::sanitize() erroneously does wp_unslash() on $value, but
	 * we remove that in this override.
	 *
	 * @since 4.3.0
	 * @since 5.9.0 Renamed `$menu_item_value` to `$value` for PHP 8 named parameter support.
	 *
	 * @param array $value The menu item value to sanitize.
	 * @return array|false|null|WP_Error Null or WP_Error if an input isn't valid. False if it is marked for deletion.
	 *                                   Otherwise the sanitized value.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
Related Hooks

Related hooks will be displayed here in future updates.