diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 601ca05a14..c513e7f082 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -127,6 +127,9 @@ foreach ( array( 'term_name_rss' ) as $filter ) { add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 ); add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); +// Pre save post data +add_filter( 'wp_insert_post_data', '_post_formats_fix_empty_title', 10, 2 ); + // Display filters add_filter( 'the_title', 'wptexturize' ); add_filter( 'the_title', 'convert_chars' ); @@ -251,7 +254,6 @@ add_action( 'init', 'smilies_init', add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); -add_action( 'wp_insert_post_data', '_post_formats_fix_empty_title', 10, 2 ); add_action( 'wp_insert_post', 'wp_save_post_revision', 10, 1 ); add_action( 'publish_post', '_publish_post_hook', 5, 1 ); add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index f5e90aef27..7993b538d6 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -979,10 +979,14 @@ function _post_formats_generate_title( $content, $post_format = '' ) { } /** - * Runs during save_post, fixes empty titles for asides and statuses. + * Fixes empty titles for aside and status formats. + * + * Passes a generated post title to the 'wp_insert_post_data' filter. * * @since 3.6.0 * @access private + * + * @uses _post_formats_generate_title() */ function _post_formats_fix_empty_title( $data, $postarr ) { if ( 'auto-draft' == $data['post_status'] || ! post_type_supports( $data['post_type'], 'post-formats' ) )