Coding Standards: Use more meaningful variable names in Plugin Editor.
Per the [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#naming-conventions Naming Conventions]: > Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting. Follow-up to [10879], [41721]. Props costdev, mukesh27. See #63168. Built from https://develop.svn.wordpress.org/trunk@60928 git-svn-id: http://core.svn.wordpress.org/trunk@60264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -93,9 +93,11 @@ $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;
|
||||
$edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
|
||||
|
||||
if ( is_wp_error( $edit_result ) ) {
|
||||
$edit_error = $edit_result;
|
||||
|
||||
if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {
|
||||
$posted_content = wp_unslash( $_POST['newcontent'] );
|
||||
}
|
||||
@@ -122,9 +124,10 @@ if ( ! is_file( $real_file ) ) {
|
||||
} else {
|
||||
// Get the extension of the file.
|
||||
if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) {
|
||||
$ext = strtolower( $matches[1] );
|
||||
$extension = strtolower( $matches[1] );
|
||||
|
||||
// If extension is not in the acceptable list, skip it.
|
||||
if ( ! in_array( $ext, $editable_extensions, true ) ) {
|
||||
if ( ! in_array( $extension, $editable_extensions, true ) ) {
|
||||
wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.9-alpha-60927';
|
||||
$wp_version = '6.9-alpha-60928';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user