Make WordPress Core


Ignore:
Timestamp:
06/08/2018 03:52:22 PM (6 years ago)
Author:
azaozz
Message:

Move scheduling of old auto-draft posts deletion to get_default_post_to_edit() (where auto-drafts are created).

Fixes #44337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r43056 r43338  
    647647        if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
    648648            set_post_format( $post, get_option( 'default_post_format' ) );
     649        }
     650
     651        // Schedule auto-draft cleanup
     652        if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {
     653            wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
    649654        }
    650655    } else {
Note: See TracChangeset for help on using the changeset viewer.