Answer the question
In order to leave comments, you need to log in
How to fix GET "link" net::ERR_ABORTED 404 (Not Found) error?
Wrote a plugin for wordpress, in which I connect scripts
wp_enqueue_script('drawing', WP_PLUGIN_DIR . '/japanese-candlestick-chart' . '/script.js');
GET http://golda/var/www/golda/wp-content/plugins/japanese-candlestick-chart/script.js?ver=5.9.2 net::ERR_ABORTED 404 (Not Found)
if(!defined('ABSPATH')){ //Защита от злоумышлинников
die;
}
add_action('wp_enqueue_scripts', 'jcc_graph');
function jcc_graph() {
wp_enqueue_script('drawing', WP_PLUGIN_DIR . '/japanese-candlestick-chart' . '/script.js');
}
Answer the question
In order to leave comments, you need to log in
Apparently, the WP_PLUGIN_DIR constant contains the physical path to the plugin folder, and you need the url - i.e. path that is relative to the site.
https://wp-kama.ru/function/plugin_dir_url - try this function
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question