From be26ec48103b70e230b17c83c0b410d3429e63d8 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 21 Jul 2024 11:22:55 +0200 Subject: [PATCH 1/3] fix post excerpt typo --- admin-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-functions.php b/admin-functions.php index a51d65dd7..46c873141 100644 --- a/admin-functions.php +++ b/admin-functions.php @@ -488,7 +488,7 @@ function duplicate_post_copy_attachments( $new_id, $post ) { $cloned_child = [ 'ID' => $new_attachment_id, 'post_title' => $child->post_title, - 'post_exceprt' => $child->post_title, + 'post_excerpt' => $child->post_excerpt, 'post_author' => $new_post_author->ID, ]; wp_update_post( wp_slash( $cloned_child ) ); From fa41b67bd250002e7dfbe10417f9d7a33d42a0b6 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Mon, 22 Jul 2024 14:55:15 +0200 Subject: [PATCH 2/3] Copy attachment description --- admin-functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/admin-functions.php b/admin-functions.php index 46c873141..6f59eee67 100644 --- a/admin-functions.php +++ b/admin-functions.php @@ -489,6 +489,7 @@ function duplicate_post_copy_attachments( $new_id, $post ) { 'ID' => $new_attachment_id, 'post_title' => $child->post_title, 'post_excerpt' => $child->post_excerpt, + 'post_content' => $child->post_content, 'post_author' => $new_post_author->ID, ]; wp_update_post( wp_slash( $cloned_child ) ); From bc287e033f391894f8eb1cede2e3208b05698577 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Mon, 22 Jul 2024 14:55:57 +0200 Subject: [PATCH 3/3] Document the fields. --- admin-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-functions.php b/admin-functions.php index 6f59eee67..c95b1b2a8 100644 --- a/admin-functions.php +++ b/admin-functions.php @@ -488,8 +488,8 @@ function duplicate_post_copy_attachments( $new_id, $post ) { $cloned_child = [ 'ID' => $new_attachment_id, 'post_title' => $child->post_title, - 'post_excerpt' => $child->post_excerpt, - 'post_content' => $child->post_content, + 'post_excerpt' => $child->post_excerpt, // Caption. + 'post_content' => $child->post_content, // Description. 'post_author' => $new_post_author->ID, ]; wp_update_post( wp_slash( $cloned_child ) );