edit_(field) filter-hookWP 2.3.0

Filters the value of a specific post field to edit.

The dynamic portion of the hook name, $field, refers to the post field name.

Usage

add_filter( 'edit_(field)', 'wp_kama_edit_field_filter', 10, 2 );

/**
 * Function for `edit_(field)` filter-hook.
 * 
 * @param mixed $value   Value of the post field.
 * @param int   $post_id Post ID.
 *
 * @return mixed
 */
function wp_kama_edit_field_filter( $value, $post_id ){

	// filter...
	return $value;
}
$value(mixed)
Value of the post field.
$post_id(int)
Post ID.

Changelog

Since 2.3.0 Introduced.

Where the hook is called

sanitize_post_field()
edit_(field)
sanitize_bookmark_field()
edit_(field)
sanitize_user_field()
edit_(field)
wp-includes/post.php 2776
$value = apply_filters( "edit_{$field}", $value, $post_id );
wp-includes/bookmark.php 428
$value = apply_filters( "edit_{$field}", $value, $bookmark_id );
wp-includes/user.php 1747
$value = apply_filters( "edit_{$field}", $value, $user_id );

Where the hook is used in WordPress

wp-admin/edit-form-advanced.php 82
add_action( 'edit_form_after_title', '_wp_posts_page_notice' );
wp-admin/includes/admin-filters.php 88
add_action( 'edit_form_after_title', '_disable_content_editor_for_navigation_post_type' );
wp-admin/includes/admin-filters.php 89
add_action( 'edit_form_after_editor', '_enable_content_editor_for_navigation_post_type' );
wp-admin/includes/meta-boxes.php 1480
add_action( 'edit_form_after_title', 'edit_form_image_editor' );
wp-includes/class-wp-embed.php 45
add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );
wp-includes/class-wp-embed.php 46
add_action( 'edit_page_form', array( $this, 'maybe_run_ajax_cache' ) );
wp-includes/default-filters.php 500
add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );