WordPress at a glance
filter is not described

wp_insert_post_data filter-hook . WP 2.7.0

Filters slashed post data just before it is inserted into the database.


add_filter( 'wp_insert_post_data', 'filter_function_name_5451', 10, 3 );
function filter_function_name_5451( $data, $postarr, $unsanitized_postarr ){
	// filter...

	return $data;
An array of slashed, sanitized, and processed post data.
An array of sanitized (and slashed) but otherwise unmodified post data.
An array of slashed yet unsanitized and unprocessed post data as originally passed to wp_insert_post().

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

С версии 2.7.0 Введена.
С версии 5.4.1 $unsanitized_postarr argument added.

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

wp-includes/post.php 3971
$data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );

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

wp-admin/includes/ms-admin-filters.php 29
add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
wp-includes/class-wp-customize-manager.php 2943
add_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );
wp-includes/class-wp-customize-manager.php 2974
remove_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5 );
wp-includes/default-filters.php 87
add_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data', 10, 2 );