(field)_pre
Filters the value of a specific post field before saving.
Only applied to post fields with a name which is not prefixed with post_.
The dynamic portion of the hook name, $field, refers to the post field name. Possible filter names include:
- ID_pre
- comment_status_pre
- ping_status_pre
- to_ping_pre
- pinged_pre
- guid_pre
- menu_order_pre
- comment_count_pre
Usage
add_filter( '(field)_pre', 'wp_kama_field_pre_filter' ); /** * Function for `(field)_pre` filter-hook. * * @param mixed $value Value of the post field. * * @return mixed */ function wp_kama_field_pre_filter( $value ){ // filter... return $value; }
- $value(mixed)
- Value of the post field.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
(field)_pre
wp-includes/post.php 3147
$value = apply_filters( "{$field}_pre", $value );