Update _post_formats_fix_empty_title() description. Make it clear that 'wp_insert_post_data' is a filter, not an action. props DrewAPicture. fixes #24303.
git-svn-id: http://core.svn.wordpress.org/trunk@24233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7aca821e4c
commit
4f2a58e3df
|
@ -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 );
|
||||
|
|
|
@ -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' ) )
|
||||
|
|
Loading…
Reference in New Issue