edit_(field) хук-фильтрWP 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.

Использование

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(разное)
Value of the post field.
$post_id(int)
Post ID.

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

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