Does this help?:
return plugins_url('/js/'. $scriptPath, '__FILE__');
OR
return plugins_url('/code/<your php file name here>', '__FILE__');
Try the Codex for plugins_url
as well.
Related Posts:
- Does a plugin’s “main” file need to be named the same as the folder containing it?
- Symlinked plugin directory doesn’t appear in Admin
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Customizing subject in comment notification e-mails
- enqueue script only if it is not already enqueue
- Add content to /wp-admin/plugin-install.php admin screens
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- How can I limit functionality in one version of a plugin?
- Activate Plugin which is in subfolder?
- Plugin child folder?
- merging an array to an existing array using add_filter
- How do I store information in a dynamic block in WordPress?
- Is it possible to set up multistore in Woocommerce? [closed]
- Find the URL of the current plugin directory
- Retrieving plugin options value saved through setting
- How to generate video out of images via WordPress plugin
- How to ‘clone’ a wp plugin to make small changes
- How to slice an array using posts_per_page? [closed]
- Get plugin option in another PHP file
- Enqueue WordPress plugin scripts below all other JS
- woocommerce payment gateway callback not firing [closed]
- White page by using filter template_include
- Is there any kind of theme on WordPress to sell my own movies?
- How to export post 2 posts WordPress plugin data [closed]
- Customization API for plugin development
- User switching only with specific role and return
- Fromcraft Plugin On click submit button [closed]
- Adding Font Awesome to WP Plugin
- How to redirect users to their profile after they successfully edit their profile
- Display custom content using page.php from theme
- WordPress error: Options page Setting_ not found in the allowed options list
- What is wordpress way to access a plugin’s classes/models to load custom post type data?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Translations for my plugin don’t show up
- flush_rewrite_rules() not working with update_option_{$option}
- Translation issue with global variables
- How to ignore extra whitespaces in translation functions like _e?
- How does translation (gettext) work for translating config file of plugin?
- Is there a better way of handling AJAX requests in WordPress?
- how to add a comment button to be displayed only for the posts in the home page [closed]
- How to add category and subcategory in WordPress custom code?
- The “Child Pages Shortcode” plugin, block template
- using wp_footer hook in a plugin
- Can’t create tables with my plugin
- How to get a custom page through plugin?
- Is it possible/advisable to set last stable version to previous version?
- How to make sure settings are not lost when plugin is updated?
- How Can i import plugin option?
- How to Get Category Name When Export Products
- Remove List Bullets
- How to override any plugin file in the child theme
- How to set plugin auto-update Enabled by default?
- Custom plugin activation error
- How to overwrite a plugin?
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- How to capture hidden values with Gravity Forms
- How to translate to spanish wordpress hardcoded content/files?
- Custom Plugin Update
- How do I stop plugins and themes from getting updated in a new plugin?
- How come W3TC is allowed to host premium code in the WordPress repo?
- Multiple image selection custom widget
- How to Create a Learning Management Plugin in WordPress to Manage Courses [LMS]
- Passing function into add_action always returns the first argument
- Paid Membership Pro displaying a user name in PHP
- Make another copy of a plugin and install it
- Store admin page into variable
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Overwriting Plugin’s Ajax callback function from theme
- Creating Nested custom fields
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Enahanced search for edit.php and custom post type
- Unable to sync woocommerce variations
- Can’t find variable is_single in my jQuery plugin
- WordPress Cron function is not working
- API Functions to Register and Show WordPress List Tables
- How to save default values into an option and delete those upon actvation and deactivation in wordpress?
- How to Add Jquery FullCalendar in wp plugin in admin
- Plugin hook breaks new WP 4.0 media library grid view?
- Ajax, jQuery and WordPress
- How to get site homepage from plugin?
- Unable to show 4 products in a row
- WordPress check box unchecked on null value ternary operator [plugin development]
- How to add image for custom taxonomy
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- wordpress Ajax success doesn’t return the value
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- How to give specific class name to category in wordpress with code snippets
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files