Here is my code:
<?php
/*
Plugin Name: Awesome Form Validation
Plugin URI: http://itexpertbd.com
Description: Use 'required' class to enable an input as required.
Version: 1.0
Author: Abdus Sattar Bhuiyan
Author URI: www.facebook.com/abdus.s.bhuiyan
*/
function awesome_form_validation_scripts() {
// wp_enqueue_style( 'awesome_form_validation', get_stylesheet_uri() );
wp_enqueue_script( 'awesome_form_validation', plugin_dir_url( __FILE__ ). '/js/form_validation.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'awesome_form_validation_scripts' );
Its pretty simple. But after activating plugin I can't see the awesome_form_validation inspecting view page source. Whats wrong with my code?
plugin_dir_url
contains a trailing slash, are you sure the URL to your file is correct?wp_footer()
function to output the script?