Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

block css not loading (wrong path) in roots bedrock environment (fix included) #526

@lemon3

Description

@lemon3

Feature description

can you please update the function get_url_from_path() in class-util.php

Use case

roots bedrock environment (or when the WP_HOME !== WP_SITEURL)

Additional information

here is my „new“ get_url_from_path() function in class-util.php

public function get_url_from_path( $path ) {
		// uri to current stylesheet directory
		$uri = get_stylesheet_directory_uri();
		// get the current (child-)theme name
		$theme_name = substr($uri, strrpos($uri, '/')+1);
		// relative path to the style file
		$rel_path = substr($path, strrpos($path, $theme_name) + strlen($theme_name));
		// stylesheet url
		return $uri . $rel_path;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions