(field_no_prefix)_save_pre
Filters the value of a specific field before saving.
Only applied to post fields with a name which is prefixed with post_.
The dynamic portion of the hook name, $field_no_prefix, refers to the post field name minus the post_ prefix. Possible filter names include:
- author_save_pre
- date_save_pre
- date_gmt_save_pre
- content_save_pre
- title_save_pre
- excerpt_save_pre
- status_save_pre
- password_save_pre
- name_save_pre
- modified_save_pre
- modified_gmt_save_pre
- content_filtered_save_pre
- parent_save_pre
- type_save_pre
- mime_type_save_pre
Usage
add_filter( '(field_no_prefix)_save_pre', 'wp_kama_field_no_prefix_save_pre_filter' );
/**
* Function for `(field_no_prefix)_save_pre` filter-hook.
*
* @param mixed $value Value of the post field.
*
* @return mixed
*/
function wp_kama_field_no_prefix_save_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_no_prefix)_save_pre
wp-includes/post.php 3148
$value = apply_filters( "{$field_no_prefix}_save_pre", $value );
Where the hook is used in WordPress
wp-includes/block-supports/custom-css.php 258
add_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
wp-includes/block-supports/custom-css.php 259
add_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
wp-includes/block-supports/custom-css.php 270
remove_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
wp-includes/block-supports/custom-css.php 271
remove_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks', 8 );
wp-includes/default-filters.php 323
add_filter( 'title_save_pre', 'trim' );
wp-includes/kses.php 2464
add_filter( 'title_save_pre', 'wp_filter_kses' );
wp-includes/kses.php 2474
add_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2475
add_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2478
add_filter( 'content_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2479
add_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2480
add_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2497
remove_filter( 'title_save_pre', 'wp_filter_kses' );
wp-includes/kses.php 2504
remove_filter( 'content_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2505
remove_filter( 'content_filtered_save_pre', 'wp_filter_global_styles_post', 9 );
wp-includes/kses.php 2508
remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2509
remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' );
wp-includes/kses.php 2510
remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' );