WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/04/2016 05:28:27 PM (5 years ago)
Author:
westonruter
Message:

Customize: Ensure a custom_css post insertion gets an initial post revision.

Props georgestephanis, westonruter.
See #30854, #38672, #35395.
Fixes #39032.

File:
1 edited

Legend:

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

    r39350 r39477  
    17871787    } else {
    17881788        $r = wp_insert_post( wp_slash( $post_data ), true );
    1789     }
    1790 
    1791     if ( $r instanceof WP_Error ) {
     1789
     1790        // Trigger creation of a revision. This should be removed once #30854 is resolved.
     1791        if ( ! is_wp_error( $r ) && 0 === count( wp_get_post_revisions( $r ) ) ) {
     1792            wp_save_post_revision( $r );
     1793        }
     1794    }
     1795
     1796    if ( is_wp_error( $r ) ) {
    17921797        return $r;
    17931798    }
Note: See TracChangeset for help on using the changeset viewer.