Customize: Ensure a `custom_css` post insertion gets an initial post revision.
Props georgestephanis, westonruter. See #30854, #38672, #35395. Fixes #39032. Built from https://develop.svn.wordpress.org/trunk@39477 git-svn-id: http://core.svn.wordpress.org/trunk@39417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
27475953bc
commit
0a31089bf6
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1786,9 +1786,14 @@ function wp_update_custom_css_post( $css, $args = array() ) {
|
||||||
$r = wp_update_post( wp_slash( $post_data ), true );
|
$r = wp_update_post( wp_slash( $post_data ), true );
|
||||||
} else {
|
} else {
|
||||||
$r = wp_insert_post( wp_slash( $post_data ), true );
|
$r = wp_insert_post( wp_slash( $post_data ), true );
|
||||||
|
|
||||||
|
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
||||||
|
if ( ! is_wp_error( $r ) && 0 === count( wp_get_post_revisions( $r ) ) ) {
|
||||||
|
wp_save_post_revision( $r );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $r instanceof WP_Error ) {
|
if ( is_wp_error( $r ) ) {
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
return get_post( $r );
|
return get_post( $r );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.8-alpha-39475';
|
$wp_version = '4.8-alpha-39477';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue