title_save_pre хук-фильтрWP 2.3.0

Filters the value of a specific field before saving.

Only applied to post fields with a name which is prefixed with post_.

Это один из вариантов динамического хука (field_no_prefix)_save_pre

Использование

add_filter( 'title_save_pre', 'wp_kama_title_save_pre_filter' );

/**
 * Function for `title_save_pre` filter-hook.
 * 
 * @param mixed $value Value of the post field.
 *
 * @return mixed
 */
function wp_kama_title_save_pre_filter( $value ){

	// filter...
	return $value;
}
$value(разное)
Value of the post field.

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

sanitize_post_field()
title_save_pre
WP_Customize_Nav_Menu_Item_Setting::sanitize()
title_save_pre
wp-includes/post.php 3052
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 719
$menu_item_value['title'] = wp_unslash( apply_filters( 'title_save_pre', wp_slash( $menu_item_value['title'] ) ) );

Где используется хук в WordPress

wp-includes/default-filters.php 316
add_filter( 'title_save_pre', 'trim' );
wp-includes/kses.php 2277
add_filter( 'title_save_pre', 'wp_filter_kses' );
wp-includes/kses.php 2310
remove_filter( 'title_save_pre', 'wp_filter_kses' );