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

Filters the value of a specific post field for display.

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

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

add_filter( '(field)', 'wp_kama_field_filter', 10, 3 );

/**
 * Function for `(field)` filter-hook.
 * 
 * @param mixed  $value   Value of the prefixed post field.
 * @param int    $post_id Post ID.
 * @param string $context Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
 *
 * @return mixed
 */
function wp_kama_field_filter( $value, $post_id, $context ){

	// filter...
	return $value;
}
$value(разное)
Value of the prefixed post field.
$post_id(int)
Post ID.
$context(строка)
Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
По умолчанию: 'display'

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

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

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

sanitize_post_field()
(field)
sanitize_bookmark_field()
(field)
sanitize_user_field()
(field)
wp-includes/post.php 2905
$value = apply_filters( "{$field}", $value, $post_id, $context );
wp-includes/bookmark.php 442
$value = apply_filters( "{$field}", $value, $bookmark_id, $context );
wp-includes/user.php 1821
$value = apply_filters( "{$field}", $value, $user_id, $context );

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

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