Fix branchhing in edit_post() where attachment_fields_to_save would only run when the alt text was sent. It should run whenever an attachment is saved. props sc0ttclark. fixes #22774.
git-svn-id: https://develop.svn.wordpress.org/trunk@23088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dc3a34b19b
commit
90e5fd56c0
@ -225,12 +225,14 @@ function edit_post( $post_data = null ) {
|
||||
}
|
||||
|
||||
// Attachment stuff
|
||||
if ( 'attachment' == $post_data['post_type'] && isset( $post_data['_wp_attachment_image_alt'] ) ) {
|
||||
$image_alt = get_post_meta( $post_ID, '_wp_attachment_image_alt', true );
|
||||
if ( $image_alt != stripslashes( $post_data['_wp_attachment_image_alt'] ) ) {
|
||||
$image_alt = wp_strip_all_tags( stripslashes( $post_data['_wp_attachment_image_alt'] ), true );
|
||||
// update_meta expects slashed
|
||||
update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) );
|
||||
if ( 'attachment' == $post_data['post_type'] ) {
|
||||
if ( isset( $post_data[ '_wp_attachment_image_alt' ] ) ) {
|
||||
$image_alt = get_post_meta( $post_ID, '_wp_attachment_image_alt', true );
|
||||
if ( $image_alt != stripslashes( $post_data['_wp_attachment_image_alt'] ) ) {
|
||||
$image_alt = wp_strip_all_tags( stripslashes( $post_data['_wp_attachment_image_alt'] ), true );
|
||||
// update_meta expects slashed
|
||||
update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $post_data['attachments'][ $post_ID ] ) )
|
||||
|
Loading…
Reference in New Issue
Block a user