Enqueue Stylesheets functionality is broken
-
Hi,
Enqueue Stylesheets functionality is broken in 2.1.3.
The visible effect of the bug is that css file couldn’t be found and returns 404 error.
The actual reason is that css file’s uri is wrong – see enqueue_files function in class-wp-scss.php, line 215 “$relative_path = …”.
Below is my suggestion how to fix this:
public function enqueue_files() { $css_dir_uri = get_site_url() . '/' . str_replace( ABSPATH, '', $this->css_dir ); foreach( new DirectoryIterator($this->css_dir) as $stylesheet ) { if ( pathinfo($stylesheet, PATHINFO_EXTENSION) == 'css' ) { $name = 'wp-scss-' . pathinfo($stylesheet, PATHINFO_FILENAME); $uri = $css_dir_uri . $stylesheet->getFilename(); $ver = $stylesheet->getMTime(); wp_register_style( $name, $uri, array(), $ver, $media = 'all' ); if(!$this->style_url_enqueued($uri)){ wp_enqueue_style($name); } } } }
I’ve deployed it on my site and it works for me. You are welcome to run it through your tests. We really need the working release.
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Enqueue Stylesheets functionality is broken’ is closed to new replies.