(field)
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 | Введена. |
Где вызывается хук
(field)
wp-includes/post.php 2992
$value = apply_filters( "{$field}", $value, $post_id, $context );
wp-includes/bookmark.php 443
$value = apply_filters( "{$field}", $value, $bookmark_id, $context );
wp-includes/user.php 1856
$value = apply_filters( "{$field}", $value, $user_id, $context );