{$field_no_prefix}_save_pre
Filter HookDescription
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`Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3101 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
Value of the post field. |
Usage Examples
Basic Usage
<?php
// Hook into {$field_no_prefix}_save_pre
add_filter('{$field_no_prefix}_save_pre', 'my_custom_filter', 10, 1);
function my_custom_filter($value) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/post.php:3101
- How this hook is used in WordPress core
<?php
3096 *
3097 * @since 2.3.0
3098 *
3099 * @param mixed $value Value of the post field.
3100 */
3101 $value = apply_filters( "{$field_no_prefix}_save_pre", $value );
3102 } else {
3103 /**
3104 * Filters the value of a specific field before saving.
3105 *
3106 * Only applied to post fields with a name which is prefixed with `post_`.
PHP Documentation
<?php
/**
* 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`
*
* @since 2.3.0
*
* @param mixed $value Value of the post field.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.