pre_post_(field) хук-фильтр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( 'pre_post_(field)', 'wp_kama_pre_post_field_filter' );

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

	// filter...
	return $value;
Value of the post field.

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

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

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

wp-includes/post.php 2830
$value = apply_filters( "pre_post_{$field}", $value );

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

wp-includes/default-filters.php 100
add_filter( 'pre_post_mime_type', 'sanitize_mime_type' );