enqueue scripts/styles to use WP_PLUGIN_URL instead of WP_CONTENT_DIR path?
-
i am seeing 404 errors for js & css files, with a custom setup, where the plugin directory doesn’t reside in the WP_CONTENT_DIR.
fs-core-functions.php [li 86-94]:
Using the WP_CONTENT_DIR && content_url(), fs_asset_url() fails to set the asset directories leaving the server file path within the url.within the plugin’s /config.php [li 108-119], i notice that each of the asset paths are assigned as directory paths instead of url paths.
is it possible to either:
- use the WP_PLUGIN_URL constants to support custom folder structures: ex. where the WP_PLUGIN_URL is: https://domain.tld/vendor
wp-config.php
//includes dirpath define( 'WP_PLUGIN_DIR', ABSPATH . <custom_plugin_directory> ); //accessible urlpath define( 'WP_PLUGIN_URL', WP_SITEURL . '/' . <custom_plugin_directory> );
OR
- update the directory paths to url paths CONSTANTS within the config.php for items accessed in the browser?
[ WP_FS__DIR_ASSETS, WP_FS__DIR_CSS, WP_FS__DIR_JS, WP_FS__DIR_IMG ]
i see the WP_PLUGIN_URL constant used elsewhere in the plugin code. & thought it may reduce function calls to ascertain enqueue urls for assets, & allow for uncommon setups.
????
thanks
- The topic ‘enqueue scripts/styles to use WP_PLUGIN_URL instead of WP_CONTENT_DIR path?’ is closed to new replies.