WordPress at Your Fingertips
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_9757', 10, 3 );
function filter_function_name_9757( $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().


Since 2.7.0 Introduced.
Since 5.4.1 $unsanitized_postarr argument added.

Where the hook is called

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

Where in WP core the hook is used WordPress

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 2945
add_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );
wp-includes/class-wp-customize-manager.php 2976
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 );