$file =
$plugin_files[0
];
}$file =
validate_file_to_edit( $file,
$plugin_files );
$real_file = WP_PLUGIN_DIR . '/' .
$file;
// Handle fallback editing of file when JavaScript is not available.
$edit_error = null;
$posted_content = null;
if ( 'POST' ===
$_SERVER['REQUEST_METHOD'
] ) { $r =
wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
if ( is_wp_error( $r ) ) { $edit_error =
$r;
if ( check_ajax_referer( 'edit-plugin_' .
$file, 'nonce', false
) &&
isset( $_POST['newcontent'
] ) ) { $posted_content =
wp_unslash( $_POST['newcontent'
] );
} } else { wp_redirect( add_query_arg( array
( 'a' => 1, // This means "success" for some reason.
'plugin' =>
$plugin,