--- a/wp/wp-admin/plugin-editor.php Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-admin/plugin-editor.php Fri Sep 05 18:52:52 2025 +0200
@@ -85,6 +85,9 @@
$file = validate_file_to_edit( $file, $plugin_files );
$real_file = WP_PLUGIN_DIR . '/' . $file;
+$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_files[0] );
+$plugin_name = $plugin_data['Name'];
+
// Handle fallback editing of file when JavaScript is not available.
$edit_error = null;
$posted_content = null;
@@ -220,23 +223,30 @@
<?php
if ( is_plugin_active( $plugin ) ) {
if ( is_writable( $real_file ) ) {
- /* translators: %s: Plugin file name. */
- printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ /* translators: %s: Plugin name. */
+ printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' );
} else {
- /* translators: %s: Plugin file name. */
- printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ /* translators: %s: Plugin name. */
+ printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' );
}
} else {
if ( is_writable( $real_file ) ) {
- /* translators: %s: Plugin file name. */
- printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ /* translators: %s: Plugin name. */
+ printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' );
} else {
- /* translators: %s: Plugin file name. */
- printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
+ /* translators: %s: Plugin name. */
+ printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' );
}
}
?>
</h2>
+<?php
+printf(
+ /* translators: %s: File path. */
+ ' <span><strong>' . __( 'File: %s' ) . '</strong></span>',
+ esc_html( $file )
+);
+?>
</div>
<div class="alignright">
<form action="plugin-editor.php" method="get">