get_template_directory_uri
works in a plugin, in that it returns the active theme directory URI, which is what the template directory is.
If you’re trying to get the URI for your plugin assets, then you want plugin_dir_url
.
wp_enqueue_script(
'jquery-repeater-form',
plugin_dir_url( __FILE__ ) . 'js/sample.js'
);
Related Posts:
- How can I find plugins’ slug?
- How to implement WordPress plugin update that modifies the database?
- My custom made plugin has “a new version available” which links to unrelated plugin
- wp.media update options and force render on uploader
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- WordPress Plugin Development from Scratch. How? [closed]
- Customize plugin update “new version is available” text
- “Donate to this plugin” for WordPress.org Plugin Authors
- How to handel multiple checkbox field in the admin settings page with Settings API
- How to show custom message once on plugin activation?
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- How to fetch serialized data from wordpress options
- Passing URL parameters to WordPress pages and pretty url
- How to Reload the Dashboard After Clicking Update in Quick-Edit?
- wp_verify_nonce() why return false?
- How to call bind function in wordpress actions or hooks
- Localize Plugin Description
- Display future posts?
- WordPress plugin for mail subscriptions [closed]
- Passing RichText attributes to function onChange
- Getting media library popup in custom plugin admin page
- Variable from a plugin into a theme
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- How to automate wordpress plugin activate and deactivate by php logic?
- How to get variables from fucntion.php to my plugin files
- WordPress Automatic Plugin Update Renames Plugin Directory
- ‘wp_login’ action hook not working with wp-login.php file
- HTML in WooCommerce settings
- Can WordPress Plugin Directory Cache Delay the Upload of Images?
- What function can I use consistently to escape possible HTML for editing and display?
- Redirecting to home page after login as custom role WordPress
- Where (or when) should I register a new taxonomy?
- How to change custom post type pemalink Hierarcy
- Test files for plugin development
- Fixing WordPress’s Bug (failed to send buffer of zlib output compression) results in “White Screen of Death”
- Disable woocommerce cookies and delete cart data automatically
- Consolidate plugin functionality into a theme
- qTranslate remove default directory from link
- WordPress Backend HA (Automatic failover)
- Count posts by type including drafts and pending posts
- List the authors that have written posts in a category
- My custom plugin did not create db tables in database
- Custom post types – remove default post supports through empty array?
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- How to be escape Variables and options when echo?
- Release the plugin in the WordPress repository where redux is used
- composer not working on my plugin when i upload it to my website
- What is the WordPress approach to custom data?
- WordPress Fatal Errors [closed]
- YOAST Seo xmlsitemap menu item not showing in the dashboard [closed]
- Possible?? Pull Plugin Property Data to a Theme’s Custom Post Type
- Using meta_query in a WP_Query not working for numbers properly
- How to rewrite URL and get the values?
- Disable plugin visibility at the plugin directory
- Plugin is creating posts twice
- How do I reliably find a URL to a script or other file?
- How to add captcha to publish widget
- How to add logo to a WordPress Custom Plugin?
- Use a custom block in another block
- Widgets are not displaying in the admin panel
- How to overwrite the category template in a plugin
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- Fixed: Console.log twice in the edit function
- Using OR Condition with facetwp facets
- How to copy the all WordPress media items to another custom plugin folder?
- Personality quiz in wordpress using a plugin
- show wc_add notices on particular page in woo commerce custom plugin development
- Error on plugin activation and creating new page
- Child theme modifications not showing up
- How to write different events from different functions in my file to a log file in WordPress
- Create a form and have custom menu display based on user answers?
- How to make a plugin api route have permission?
- Function settings_fields() not recognized (Uncaught Error: Call to undefined function settings_fields())
- Why my multisite is this slow? (stats inside)
- what’s different between wpdb->prefix and table_prefix
- Can we rename a plugin directory for a already launched plugin?
- How to use custom footer template in a site-plugin?
- Problem with conditional woocommerce custom checkout field
- trying to create simple plugin to filter categories from all authors
- How to create a new database table whenever user changes options
- Am I correctly adding styles to plugin?
- How can I insert a record into a custom table from my custom form in my custom admin page?
- how to create table during plugin installation in side a class
- Change wp_mail SMTP settings for each E-Mail
- Proper Failure of Plugin Activation
- Why function hooked using object are executing at all time?
- WordPress Thumbnail add action if no thumbnail
- What is the Object for WP_Error Class?
- How can I add the custom taxonomy categories to the posts and pages?
- Pass strings to plugin function [closed]
- Ajax in Plugins: returns the whole page
- How to create a page template using custom plugin
- WordPress 3,5 and Jquery version
- how to search through plugin in wordpress cimy-user-extra-fields?
- Any way to hook into WP after a page displays?
- contact form 7 captcha support anyother captcha plugin? [closed]
- how to make wordpress remember my choice
- Meta box not displaying on the plugin page
- wordpress admin-ajax bad request 400
- public custom posts not showing in my wordpress plugin