This plugin does not register it’s script correctly
-
The plugin registers it’s script with a hardcoded wp-content and plugin directory:
wp_register_script($this->_optionsPrefix.'main_js', site_url().'/wp-content/plugins/admin-category-search/js/adminSearch.js');
This is wrong and does not work in bedrocks
The correct way to register the script is ( it also doesn’t need to be both registered and enqueued, it can be enqueued straight away)wp_enqueue_script($this->_optionsPrefix.'main_js', plugin_dir_url( __FILE__ ) . 'js/adminSearch.js', array(), false, true);wp_enqueue_script($this->_optionsPrefix.$key, plugin_dir_url( __FILE__ ) . 'js/'.$key.'.js', array(), false, true);
The topic ‘This plugin does not register it’s script correctly’ is closed to new replies.