Extra Slash in Assets Path
-
Hello!
I noticed there is an extra slash in the path for all of the plugins assets.
For example:
example.com/wp-content/plugins/column-shortcodes//assets/css/shortcodes.css* Notice the double slash before assets.
I’ve added this fix to my sites and it resolves it:
https://gist.github.com/emaildano/1fbb4efd9382a0de3705bdff3a76d432Original Code Example:
wp_enqueue_style( 'cpsh-admin', $this->get_url() . '/assets/css/admin.css', array(), $this->get_version(), 'all' );New Code Example:
wp_enqueue_style( 'cpsh-admin', $this->get_url() . 'assets/css/admin.css', array(), $this->get_version(), 'all' );Some browsers like Chrome won’t throw a 404 error since they account for common errors like a double slash. However, using a performance testing tool or static site generator for WordPress like Shifter it won’t account for that.
The topic ‘Extra Slash in Assets Path’ is closed to new replies.