function Zumper_widget_enqueue_script()
{
wp_enqueue_script('jquery-repeater-form',get_template_directory_uri().'/admin/js/sample.js');
}
add_action('admin_print_scripts-widgets.php', 'Zumper_widget_enqueue_script');
Suppose a javascript is sitting in my wordpress theme in this path- admin/js/sample.js
and the theme is using wp_enqueue_script to include this file -
wp_enqueue_script('jquery-repeater-form',get_template_directory_uri().'/admin/js/sample.js');
Now my question is if I am transferring the widget and javascript to plugin- widget codes will go in plugin.php file and javascript file will go into this path -
js/sample.js
I am enqueing it like this -
wp_enqueue_script('jquery-repeater-form',get_template_directory_uri().'/js/sample.js');
but its not getting included.
Is this function unable to pull the correct path - get_template_directory_uri() when used in plugin folder?