From 033bd15064f9bf271b6ca5694840d169f2b6635d Mon Sep 17 00:00:00 2001
From: Shreyas Ikhar
Date: Tue, 28 Apr 2026 16:39:02 +0530
Subject: [PATCH 1/3] Add action hooks after attachment details fields in a
template
---
src/wp-includes/media-template.php | 48 ++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
index bc887bafd1197..11f8fbf38d836 100644
--- a/src/wp-includes/media-template.php
+++ b/src/wp-includes/media-template.php
@@ -522,6 +522,12 @@ function wp_print_media_templates() {
+
<# } #>
@@ -529,6 +535,12 @@ function wp_print_media_templates() {
+
<# if ( 'audio' === data.type ) { #>
+
+
@@ -774,6 +798,12 @@ function wp_print_media_templates() {
+
<# } #>
@@ -781,6 +811,12 @@ function wp_print_media_templates() {
+
<# if ( 'audio' === data.type ) { #>
+
+
From 12fc7eea481234d7528ae1d6ae3bbf44359d48db Mon Sep 17 00:00:00 2001
From: Shreyas Ikhar
Date: Tue, 28 Apr 2026 17:02:39 +0530
Subject: [PATCH 2/3] Address phpcs feedback
---
src/wp-includes/media-template.php | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
index 11f8fbf38d836..c638dc73f35ed 100644
--- a/src/wp-includes/media-template.php
+++ b/src/wp-includes/media-template.php
@@ -535,12 +535,12 @@ function wp_print_media_templates() {
-
+
<# if ( 'audio' === data.type ) { #>
-
+
<# if ( 'audio' === data.type ) { #>
Date: Tue, 28 Apr 2026 17:22:35 +0530
Subject: [PATCH 3/3] Fix hooks placement for attachment details template
---
src/wp-admin/includes/media.php | 17 +++++++++++++++++
src/wp-includes/media-template.php | 26 +-------------------------
2 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 7cb942f1c945f..79de8861ff264 100644
--- a/src/wp-admin/includes/media.php
+++ b/src/wp-admin/includes/media.php
@@ -3270,6 +3270,12 @@ function edit_form_image_editor( $post ) {
?>
+
@@ -3278,6 +3284,10 @@ function edit_form_image_editor( $post ) {
'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
$editor_args = array(
@@ -3308,6 +3318,13 @@ function edit_form_image_editor( $post ) {
post_content ), 'attachment_content', $editor_args ); ?>
+
+
+
-
<# } #>
@@ -798,12 +798,6 @@ function wp_print_media_templates() {
-
<# } #>
@@ -811,12 +805,6 @@ function wp_print_media_templates() {
-
<# if ( 'audio' === data.type ) { #>
-
-