pre_post_mime_type
Filters the value of a specific post field before saving.
Only applied to post fields with a name which is prefixed with post_.
- pre_post_author
- pre_post_date
- pre_post_date_gmt
- pre_post_content
- pre_post_title
- pre_post_excerpt
- pre_post_status
- pre_post_password
- pre_post_name
- pre_post_modified
- pre_post_modified_gmt
- pre_post_content_filtered
- pre_post_parent
- pre_post_type
- pre_post_mime_type
This is one of the variants of the dynamic hook pre_(field)
Usage
add_filter( 'pre_post_mime_type', 'wp_kama_pre_post_mime_type_filter' ); /** * Function for `pre_post_mime_type` filter-hook. * * @param mixed $value Value of the post field. * * @return mixed */ function wp_kama_pre_post_mime_type_filter( $value ){ // filter... return $value; }
- $value(mixed)
- Value of the post field.
Changelog
Since 2.3.0 | Introduced. |
Where the hook is called
pre_post_mime_type
wp-includes/post.php 3022
$value = apply_filters( "pre_{$field}", $value );
Where the hook is used in WordPress
wp-includes/default-filters.php 106
add_filter( 'pre_post_mime_type', 'sanitize_mime_type' );