From 68524f7c6f5b5123d786f6727bda83d4dc1a9eb4 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Thu, 6 Dec 2012 05:34:17 +0000 Subject: [PATCH] Run the attachment_fields_to_save filter even if we don't get the fields we used to get. props nacin. fixes #22774 git-svn-id: http://core.svn.wordpress.org/trunk@23094 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 23cdfc9f7c..e4866ad516 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -235,8 +235,8 @@ function edit_post( $post_data = null ) { } } - if ( isset( $post_data['attachments'][ $post_ID ] ) ) - $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $post_data['attachments'][ $post_ID ] ); + $attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array(); + $post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data ); } add_meta( $post_ID );