(field) filter-hookWP 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.

Usage

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(mixed)
Value of the prefixed post field.
$post_id(int)
Post ID.
$context(string)
Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
Default: 'display'

Changelog

Since 2.3.0 Introduced.

Where the hook is called

sanitize_post_field()
(field)
sanitize_bookmark_field()
(field)
sanitize_user_field()
(field)
wp-includes/post.php 2973
$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 1822
$value = apply_filters( "{$field}", $value, $user_id, $context );

Where the hook is used in WordPress

Usage not found.