Make WordPress Core

Changeset 60928


Ignore:
Timestamp:
10/13/2025 09:48:42 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use more meaningful variable names in Plugin Editor.

Per the 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugin-editor.php

    r60681 r60928  
    9494
    9595if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
    96     $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
    97     if ( is_wp_error( $r ) ) {
    98         $edit_error = $r;
     96    $edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
     97
     98    if ( is_wp_error( $edit_result ) ) {
     99        $edit_error = $edit_result;
     100
    99101        if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {
    100102            $posted_content = wp_unslash( $_POST['newcontent'] );
     
    123125    // Get the extension of the file.
    124126    if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) {
    125         $ext = strtolower( $matches[1] );
     127        $extension = strtolower( $matches[1] );
     128
    126129        // If extension is not in the acceptable list, skip it.
    127         if ( ! in_array( $ext, $editable_extensions, true ) ) {
     130        if ( ! in_array( $extension, $editable_extensions, true ) ) {
    128131            wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );
    129132        }
Note: See TracChangeset for help on using the changeset viewer.