Filters the value of a specific post field for display.
Description
Only applied to post fields name which is <em>not</em> prefixed with post_. The dynamic portion of the hook name, $field, refers to the post field name. Possible filter names include: <ul> <li>post_ID</li> <li>post_comment_status</li> <li>post_ping_status</li> <li>post_to_ping</li> <li>post_pinged</li> <li>post_guid</li> <li>post_menu_order</li> <li>post_comment_count</li> </ul>
Parameters
$valuemixed
Value of the unprefixed post field.
$post_idint
Post ID
$contextstring
Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'. Default 'display'.
3207* @param mixed$value Value of the unprefixed post field.3208* @param int$post_id Post ID3209* @param string$context Context for how to sanitize the field.3210* Accepts 'raw','edit','db','display',3211*'attribute',or'js'.Default'display'.3212*/3213$value=apply_filters("post_{$field}",$value,$post_id,$context);3214}32153216if('attribute'===$context){3217$value=esc_attr($value);3218}elseif('js'===$context){3219$value=esc_js($value);
History
Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.