Make WordPress Core

Changeset 29958


Ignore:
Timestamp:
10/18/2014 07:03:11 PM (10 years ago)
Author:
SergeyBiryukov
Message:

wp_add_inline_style():

  • Change the wp-inline-style-$handle class added in [29956] to $handle-inline-css for consistency with existing patterns.
  • Add the ID attribute when concatenation is enabled as well.

props georgestephanis.
see #30032.

File:
1 edited

Legend:

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

    r29956 r29958  
    111111            $this->print_html .= $tag;
    112112            if ( $inline_style = $this->print_inline_style( $handle, false ) )
    113                 $this->print_html .= sprintf( "<style type='text/css'>\n%s\n</style>\n", $inline_style );
     113                $this->print_html .= sprintf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $inline_style );
    114114        } else {
    115115            echo $tag;
     
    148148        }
    149149
    150         echo "<style id='wp-inline-style-" . esc_attr( $handle ) . "' type='text/css'>\n";
    151         echo "$output\n";
    152         echo "</style>\n";
     150        printf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $output );
    153151
    154152        return true;
Note: See TracChangeset for help on using the changeset viewer.