(field_no_prefix)_save_pre хук-фильтрWP 2.3.0

Filters the value of a specific field before saving.

The dynamic portion of the hook name, $field_no_prefix, refers to the post field name.

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

add_filter( '(field_no_prefix)_save_pre', 'wp_kama_field_no_prefix_save_pre_filter' );

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

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

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

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

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

sanitize_post_field()
(field_no_prefix)_save_pre
wp-includes/post.php 2828
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );

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

wp-includes/default-filters.php 303
add_filter( 'title_save_pre', 'trim' );
wp-includes/kses.php 2151
add_filter( 'title_save_pre', 'wp_filter_kses' );
wp-includes/kses.php 2161
add_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2162
add_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2165
add_filter( 'content_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2166
add_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2167
add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2184
remove_filter( 'title_save_pre', 'wp_filter_kses' );
wp-includes/kses.php 2191
remove_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2192
remove_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2195
remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2196
remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2197
remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );