Theme Customizer: Improve background image control, add correct meta key to custom headers and backgrounds uploaded using the customizer. see #19910.

git-svn-id: https://develop.svn.wordpress.org/trunk@20913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-05-25 20:26:25 +00:00
parent 2cd502fdfb
commit b1e5b31c58
4 changed files with 61 additions and 15 deletions
+8
View File
@@ -1640,6 +1640,14 @@ function wp_ajax_upload_attachment() {
wp_die();
}
if ( isset( $post_data['context'] ) && isset( $post_data['theme'] ) ) {
if ( 'custom-background' === $post_data['context'] )
update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', $post_data['theme'] );
if ( 'custom-header' === $post_data['context'] )
update_post_meta( $attachment_id, '_wp_attachment_is_custom_header', $post_data['theme'] );
}
$post = get_post( $attachment_id );
echo json_encode( array(