Make WordPress Core


Ignore:
Timestamp:
08/10/2024 10:58:07 PM (2 months ago)
Author:
peterwilsoncc
Message:

Code Quality: Clarify variable names in dependency classes.

Renames several variables in the WP_Scripts and WP_Styles classes to clarify their purpose for developers reading the code.

Props peterwilsoncc, sergeybiryukov.
See #61607.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-styles.php

    r55703 r58878  
    166166        }
    167167
    168         $src         = $obj->src;
    169         $cond_before = '';
    170         $cond_after = '';
    171         $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';
     168        $src                   = $obj->src;
     169        $ie_conditional_prefix = '';
     170        $ie_conditional_suffix = '';
     171        $conditional           = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';
    172172
    173173        if ( $conditional ) {
    174             $cond_before = "<!--[if {$conditional}]>\n";
    175             $cond_after = "<![endif]-->\n";
     174            $ie_conditional_prefix = "<!--[if {$conditional}]>\n";
     175            $ie_conditional_suffix = "<![endif]-->\n";
    176176        }
    177177
     
    280280
    281281        if ( $this->do_concat ) {
    282             $this->print_html .= $cond_before;
     282            $this->print_html .= $ie_conditional_prefix;
    283283            $this->print_html .= $tag;
    284284            if ( $inline_style_tag ) {
    285285                $this->print_html .= $inline_style_tag;
    286286            }
    287             $this->print_html .= $cond_after;
     287            $this->print_html .= $ie_conditional_suffix;
    288288        } else {
    289             echo $cond_before;
     289            echo $ie_conditional_prefix;
    290290            echo $tag;
    291291            $this->print_inline_style( $handle );
    292             echo $cond_after;
     292            echo $ie_conditional_suffix;
    293293        }
    294294
     
    369369     */
    370370    public function all_deps( $handles, $recursion = false, $group = false ) {
    371         $r = parent::all_deps( $handles, $recursion, $group );
     371        $result = parent::all_deps( $handles, $recursion, $group );
    372372        if ( ! $recursion ) {
    373373            /**
     
    380380            $this->to_do = apply_filters( 'print_styles_array', $this->to_do );
    381381        }
    382         return $r;
     382        return $result;
    383383    }
    384384
Note: See TracChangeset for help on using the changeset viewer.