Customize: Ensure a `custom_css` post insertion gets an initial post revision.
Merges [39477] onto 4.7 branch. Props georgestephanis, westonruter. Fixes #39032 for 4.7. Built from https://develop.svn.wordpress.org/branches/4.7@39479 git-svn-id: http://core.svn.wordpress.org/branches/4.7@39419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e918433445
commit
8f1a4c9a56
|
@ -1786,9 +1786,14 @@ function wp_update_custom_css_post( $css, $args = array() ) {
|
|||
$r = wp_update_post( wp_slash( $post_data ), true );
|
||||
} else {
|
||||
$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 get_post( $r );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-RC2-39476';
|
||||
$wp_version = '4.7-RC2-39479';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue