[CONTRIBUTION] All admin css and js not found in Windows
-
I’m using Windows 10 in localhost. After installing, all css and js within admin is broken. See the JS example URL:
It’s happen because in Windows, the path separator is backslash (__FILE__ constant). When WordPress load the scripts, the backslash is removed.
To solve this, add this code to your theme functions.php:
add_filter( 'script_loader_src', '8792359_adjust_backslash_scripts', 99, 2 ); add_filter( 'style_loader_src', '8792359_adjust_backslash_scripts', 99, 2 ); function 8792359_adjust_backslash_scripts( $src, $handle ){ $src = str_replace("\\", "/", $src); return $src; }
This force WordPress to change the backslash in URLs to normal slash and solve the problem. I suggest to the authors to change the plugin constants, replacing backslashes to normal slashes.
- The topic ‘[CONTRIBUTION] All admin css and js not found in Windows’ is closed to new replies.