What’s wrong with my use of plugin_url()?

function add_my_css_and_my_js_files(){ wp_enqueue_script(‘jquery-validate-min’, plugins_url(‘activate/jquery_validate_min.js’, __FILE__ ) ); } add_action(‘wp_enqueue_scripts’, “add_my_css_and_my_js_files”); You need to use the plugins_url() function (you are missing the s at the end of plugins). Reference the location of the script file with the relative path. Meaning the path should be activate/jquery_validate_min.js.

plugins_url() incorrectly returning wp-include directory

Masonry is already registered by WordPress. From wp-includes/script-loader.php: // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. $scripts->add( ‘masonry’, “/wp-includes/js/masonry.min.js”, array(), ‘3.1.2’, 1 ); $scripts->add( ‘jquery-masonry’, “/wp-includes/js/jquery/jquery.masonry$dev_suffix.js”, array( ‘jquery’, ‘masonry’ … Read more

tech