Plugin assumes fixed directory of ‘wangguard’, 404 errors
-
Hi Jose,
Multiple 404 errors are visible when the Plugin directory ‘wangguard’ is renamed to ‘_wangguard’, this is due to the fixed Plugin directory name being used throughout the Plugin for JS and CSS assets. This is limited to use of wp_enqueue_script() and wp_register_style().
Changing the fixed directory from:
wp_register_style( ‘wangguard_dashicons’, ‘/’ . PLUGINDIR . ‘/wangguard/css/menu.css’, false, WANGGUARD_VERSION );
to using a dynamic directory CONSTANT, using plugins_url() or a combination of both resolves this:
wp_register_style( ‘wangguard_dashicons’, plugins_url( ‘/css/menu.css’, basename( dirname( __FILE__ ) ) ), false, WANGGUARD_VERSION );
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Plugin assumes fixed directory of ‘wangguard’, 404 errors’ is closed to new replies.