post_to_ping filter-hookWP 2.3.0

Filters the value of a specific post field for display.

Only applied to post fields name which is not prefixed with post_.

This is one of the variants of the dynamic hook post_(field)

Usage

add_filter( 'post_to_ping', 'wp_kama_post_to_ping_filter', 10, 3 );

/**
 * Function for `post_to_ping` filter-hook.
 * 
 * @param mixed  $value   Value of the unprefixed 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_post_to_ping_filter( $value, $post_id, $context ){

	// filter...
	return $value;
}
$value(mixed)
Value of the unprefixed 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()
post_to_ping
wp-includes/post.php 3164
$value = apply_filters( "post_{$field}", $value, $post_id, $context );

Where the hook is used in WordPress

Usage not found.