82 $file = $plugin_files[0]; |
82 $file = $plugin_files[0]; |
83 } |
83 } |
84 |
84 |
85 $file = validate_file_to_edit( $file, $plugin_files ); |
85 $file = validate_file_to_edit( $file, $plugin_files ); |
86 $real_file = WP_PLUGIN_DIR . '/' . $file; |
86 $real_file = WP_PLUGIN_DIR . '/' . $file; |
|
87 |
|
88 $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_files[0] ); |
|
89 $plugin_name = $plugin_data['Name']; |
87 |
90 |
88 // Handle fallback editing of file when JavaScript is not available. |
91 // Handle fallback editing of file when JavaScript is not available. |
89 $edit_error = null; |
92 $edit_error = null; |
90 $posted_content = null; |
93 $posted_content = null; |
91 |
94 |
218 <div class="alignleft"> |
221 <div class="alignleft"> |
219 <h2> |
222 <h2> |
220 <?php |
223 <?php |
221 if ( is_plugin_active( $plugin ) ) { |
224 if ( is_plugin_active( $plugin ) ) { |
222 if ( is_writable( $real_file ) ) { |
225 if ( is_writable( $real_file ) ) { |
223 /* translators: %s: Plugin file name. */ |
226 /* translators: %s: Plugin name. */ |
224 printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
227 printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); |
225 } else { |
228 } else { |
226 /* translators: %s: Plugin file name. */ |
229 /* translators: %s: Plugin name. */ |
227 printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
230 printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); |
228 } |
231 } |
229 } else { |
232 } else { |
230 if ( is_writable( $real_file ) ) { |
233 if ( is_writable( $real_file ) ) { |
231 /* translators: %s: Plugin file name. */ |
234 /* translators: %s: Plugin name. */ |
232 printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
235 printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); |
233 } else { |
236 } else { |
234 /* translators: %s: Plugin file name. */ |
237 /* translators: %s: Plugin name. */ |
235 printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
238 printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); |
236 } |
239 } |
237 } |
240 } |
238 ?> |
241 ?> |
239 </h2> |
242 </h2> |
|
243 <?php |
|
244 printf( |
|
245 /* translators: %s: File path. */ |
|
246 ' <span><strong>' . __( 'File: %s' ) . '</strong></span>', |
|
247 esc_html( $file ) |
|
248 ); |
|
249 ?> |
240 </div> |
250 </div> |
241 <div class="alignright"> |
251 <div class="alignright"> |
242 <form action="plugin-editor.php" method="get"> |
252 <form action="plugin-editor.php" method="get"> |
243 <label for="plugin" id="theme-plugin-editor-selector"><?php _e( 'Select plugin to edit:' ); ?> </label> |
253 <label for="plugin" id="theme-plugin-editor-selector"><?php _e( 'Select plugin to edit:' ); ?> </label> |
244 <select name="plugin" id="plugin"> |
254 <select name="plugin" id="plugin"> |