wp/wp-admin/plugin-editor.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   193 <div class="fileedit-sub">
   193 <div class="fileedit-sub">
   194 <div class="alignleft">
   194 <div class="alignleft">
   195 <h2>
   195 <h2>
   196 	<?php
   196 	<?php
   197 	if ( is_plugin_active( $plugin ) ) {
   197 	if ( is_plugin_active( $plugin ) ) {
   198 		if ( is_writeable( $real_file ) ) {
   198 		if ( is_writable( $real_file ) ) {
   199 			/* translators: %s: Plugin file name. */
   199 			/* translators: %s: Plugin file name. */
   200 			printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   200 			printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   201 		} else {
   201 		} else {
   202 			/* translators: %s: Plugin file name. */
   202 			/* translators: %s: Plugin file name. */
   203 			printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   203 			printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   204 		}
   204 		}
   205 	} else {
   205 	} else {
   206 		if ( is_writeable( $real_file ) ) {
   206 		if ( is_writable( $real_file ) ) {
   207 			/* translators: %s: Plugin file name. */
   207 			/* translators: %s: Plugin file name. */
   208 			printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   208 			printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   209 		} else {
   209 		} else {
   210 			/* translators: %s: Plugin file name. */
   210 			/* translators: %s: Plugin file name. */
   211 			printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   211 			printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
   214 	?>
   214 	?>
   215 </h2>
   215 </h2>
   216 </div>
   216 </div>
   217 <div class="alignright">
   217 <div class="alignright">
   218 	<form action="plugin-editor.php" method="get">
   218 	<form action="plugin-editor.php" method="get">
   219 		<strong><label for="plugin"><?php _e( 'Select plugin to edit:' ); ?> </label></strong>
   219 		<label for="plugin" id="theme-plugin-editor-selector"><?php _e( 'Select plugin to edit:' ); ?> </label>
   220 		<select name="plugin" id="plugin">
   220 		<select name="plugin" id="plugin">
   221 		<?php
   221 		<?php
   222 		foreach ( $plugins as $plugin_key => $a_plugin ) {
   222 		foreach ( $plugins as $plugin_key => $a_plugin ) {
   223 			$plugin_name = $a_plugin['Name'];
   223 			$plugin_name = $a_plugin['Name'];
   224 			if ( $plugin_key === $plugin ) {
   224 			if ( $plugin_key === $plugin ) {
   273 			<?php echo $docs_select; ?>
   273 			<?php echo $docs_select; ?>
   274 			<input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" />
   274 			<input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ); ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&amp;redirect=true'); }" />
   275 		</div>
   275 		</div>
   276 	<?php endif; ?>
   276 	<?php endif; ?>
   277 
   277 
   278 	<?php if ( is_writeable( $real_file ) ) : ?>
   278 	<?php if ( is_writable( $real_file ) ) : ?>
   279 		<div class="editor-notices">
   279 		<div class="editor-notices">
   280 		<?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?>
   280 		<?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?>
   281 			<div class="notice notice-warning inline active-plugin-edit-warning">
   281 			<div class="notice notice-warning inline active-plugin-edit-warning">
   282 				<p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p>
   282 				<p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p>
   283 			</div>
   283 			</div>
   286 		<p class="submit">
   286 		<p class="submit">
   287 			<?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
   287 			<?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
   288 			<span class="spinner"></span>
   288 			<span class="spinner"></span>
   289 		</p>
   289 		</p>
   290 	<?php else : ?>
   290 	<?php else : ?>
   291 		<p><em>
   291 		<p>
   292 			<?php
   292 			<?php
   293 			printf(
   293 			printf(
   294 				/* translators: %s: Documentation URL. */
   294 				/* translators: %s: Documentation URL. */
   295 				__( 'You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.' ),
   295 				__( 'You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.' ),
   296 				__( 'https://wordpress.org/support/article/changing-file-permissions/' )
   296 				__( 'https://wordpress.org/support/article/changing-file-permissions/' )
   297 			);
   297 			);
   298 			?>
   298 			?>
   299 		</em></p>
   299 		</p>
   300 	<?php endif; ?>
   300 	<?php endif; ?>
   301 
   301 
   302 	<?php wp_print_file_editor_templates(); ?>
   302 	<?php wp_print_file_editor_templates(); ?>
   303 </form>
   303 </form>
   304 <br class="clear" />
   304 <br class="clear" />