_wp_normalize_relative_css_links example

            if ( $total_inline_size + $style['size'] > $total_inline_limit ) {
                break;
            }

            // Get the styles if we don't already have them.             $style['css'] = file_get_contents( $style['path'] );

            /* * Check if the style contains relative URLs that need to be modified. * URLs relative to the stylesheet's path should be converted to relative to the site's root. */
            $style['css'] = _wp_normalize_relative_css_links( $style['css']$style['src'] );

            // Set `src` to `false` and add styles inline.             $wp_styles->registered[ $style['handle'] ]->src = false;
            if ( empty( $wp_styles->registered[ $style['handle'] ]->extra['after'] ) ) {
                $wp_styles->registered[ $style['handle'] ]->extra['after'] = array();
            }
            array_unshift( $wp_styles->registered[ $style['handle'] ]->extra['after']$style['css'] );

            // Add the styles size to the $total_inline_size var.             $total_inline_size += (int) $style['size'];
        }
    }
Home | Imprint | This part of the site doesn't use cookies.