Filter hook '{$field_no_prefix}_edit_pre'

in WP Core File wp-includes/post.php at line 3004

View Source

{$field_no_prefix}_edit_pre

Filter Hook
Description
Filters the value of a specific post field to edit. 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_edit_pre` - `date_edit_pre` - `date_gmt_edit_pre` - `content_edit_pre` - `title_edit_pre` - `excerpt_edit_pre` - `status_edit_pre` - `password_edit_pre` - `name_edit_pre` - `modified_edit_pre` - `modified_gmt_edit_pre` - `content_filtered_edit_pre` - `parent_edit_pre` - `type_edit_pre` - `mime_type_edit_pre`

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Filter
Line Number 3004

Hook Parameters

Type Name Description
mixed $value Value of the post field.
int $post_id Post ID.

Usage Examples

Basic Usage
<?php
// Hook into {$field_no_prefix}_edit_pre
add_filter('{$field_no_prefix}_edit_pre', 'my_custom_filter', 10, 2);

function my_custom_filter($value, $post_id) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/post.php:3004 - How this hook is used in WordPress core
<?php
2999  			 * @since 2.3.0
3000  			 *
3001  			 * @param mixed $value   Value of the post field.
3002  			 * @param int   $post_id Post ID.
3003  			 */
3004  			$value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
3005  		} else {
3006  			/**
3007  			 * Filters the value of a specific post field to edit.
3008  			 *
3009  			 * Only applied to post fields not prefixed with `post_`.

PHP Documentation

<?php
/**
			 * Filters the value of a specific post field to edit.
			 *
			 * 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_edit_pre`
			 *  - `date_edit_pre`
			 *  - `date_gmt_edit_pre`
			 *  - `content_edit_pre`
			 *  - `title_edit_pre`
			 *  - `excerpt_edit_pre`
			 *  - `status_edit_pre`
			 *  - `password_edit_pre`
			 *  - `name_edit_pre`
			 *  - `modified_edit_pre`
			 *  - `modified_gmt_edit_pre`
			 *  - `content_filtered_edit_pre`
			 *  - `parent_edit_pre`
			 *  - `type_edit_pre`
			 *  - `mime_type_edit_pre`
			 *
			 * @since 2.3.0
			 *
			 * @param mixed $value   Value of the post field.
			 * @param int   $post_id Post ID.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.