WordPress.org

Make WordPress Core

Ticket #30579: bug-fix-30579.2.diff

File bug-fix-30579.2.diff, 1.7 KB (added by JulienMelissas, 6 years ago)

Added space around else statement using @kevdotbadger's patch.

  • wp-includes/class.wp-styles.php

    diff --git wp-includes/class.wp-styles.php wp-includes/class.wp-styles.php
    index 46cb913..d75a35a 100644
    class WP_Styles extends WP_Dependencies { 
    8989                 * @param string $handle The style's registered handle.
    9090                 */
    9191                $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
     92
     93                // Add stylesheet outside the <head>, HTML4 and HTML5 have different specs.
     94                if ( isset($obj->extra['in_footer']) ) {
     95                        if ( current_theme_supports('html5') ) {
     96                                $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' property='$handle-css-$rel' type='text/css' media='$media' />\n", $handle );
     97                        } else {
     98                                $tag = "<style id='$handle-css' type='text/css' media='$media'>@import url('$href')</style>\n";
     99                        }
     100                }
     101
    92102                if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
    93103                        if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
    94104                                $suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
    class WP_Styles extends WP_Dependencies { 
    234244                return false;
    235245        }
    236246
    237         public function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
     247        public function do_footer_items() {
     248                $footer_items = array_diff($this->queue, $this->done);
     249                if ( ! empty( $footer_items ) ) {
     250                        foreach ( $footer_items as $footer_item ) {
     251                                $this->registered[$footer_item]->extra['in_footer'] = true;
     252                        }
     253                }
     254
    238255                $this->do_items(false, 1);
    239256                return $this->done;
    240257        }