pre_(field) хук-фильтрWP 2.3.0

Filters the value of a specific post field before saving.

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

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

add_filter( 'pre_(field)', 'wp_kama_pre_field_filter' );

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

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

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

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

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

sanitize_post_field()
pre_(field)
sanitize_bookmark_field()
pre_(field)
sanitize_user_field()
pre_(field)
wp-includes/post.php 2822
$value = apply_filters( "pre_{$field}", $value );
wp-includes/bookmark.php 437
$value = apply_filters( "pre_{$field}", $value );
wp-includes/user.php 1788
$value = apply_filters( "pre_{$field}", $value );

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

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