In a subdirectory within your plugin directory you can use the following code:
$this->plugin_location = plugin_dir_url(dirname(__FILE__));
Related Posts:
- Namespaces in WordPress – How do I initiate the main class?
- How to include and use custom class files in plugin?
- Current user in plugin returns NULL
- Why is my custom post type not being activated on plug-in activation?
- get_option / wp_localize_script Not Working in OOP Plug In
- Built a second plugin but it overwrote the first one
- WordPress Object Oriented plugin development [closed]
- How to access OOP plugin function inside themes or other plugin
- WordPress plugin blog creation
- Get post content inside plugin class method
- How to access classes in theme of a plugin?
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- Why function hooked using object are executing at all time?
- Plugin: Custom menu item problem
- Function not being called on form submit, only blank admin-post.php page
- Custom media upload content for inserting custom post shortcode
- Making my plugin multi-site compatible
- Checking if an attribute exists in a shortcode
- How to create a WordPress plugin for another wordpress plugin?
- use WordPress theme / plugin editor in my plugin
- What is the best way to output plugin result in certain url
- WordPress adding tags into plugin content
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- This doesnt work for Plugin get_template_directory_uri()
- Is it possible to upload a template file to a directory that can be used by all themes?
- WordPress hook for visiting a post
- Fatal error: Class not found in
- Showing Notifications While Activating Plugin
- Workflow and best practice for documentation [closed]
- Creating a modal dialog without jQuery
- What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?
- Hidden Custom Post Type
- Is there a way to programmatically enable a plugin?
- How to include code into functions.php file via a plugin
- Getting user roles in plugin files
- How can I get WordPress to save comments in markdown format?
- Simple ajax call not working in wordpress plugin
- How to save post change url youtube link?
- __callStatic method handler passed to add_action causes bug in PHP
- New databes tables with – WooCommerce – for developers [closed]
- Plugin-generated pages use Not Found or Pages Archive templates?
- Most efficient way to use classes to create admin pages using Settings API
- Change commission_status paid when withdraw_status vendor is completed
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Perform internal redirect in WordPress?
- How to prevent plugins from loading jQuery
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Can plugin2 uninstall plugin1 at the very beginning of plugin2’s installation?
- Automatically download, install and activate plugins that my plugin depends, how?
- How to create WordPress custom end point with multiple parameters?
- How to redirect to same page after form submission
- plugin dev – minimum base css specificity?
- I changed font of wordpress dashboard but it is slow!
- Creating a functionality plugin to edit seriously simple podcasting
- Plugin temporary files and files to download via FTP
- Asynchronous request in wordpress
- How to add credit card validation check to wordpress [closed]
- Displaying data from another database
- Every time I de-activate a custom plugin, the site encounters a critical error
- Next Previous Post in wordpress with previous / next link with title?
- How to use existing hook in twentytwelve to all theme of wordpress?
- Apply html elements in php statement
- 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 capture hidden values with Gravity Forms
- How to translate to spanish wordpress hardcoded content/files?
- 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]
- Woocommerce functions in custom class, avoid errors
- 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
- How can I get the Post ID and Post Type within a Must Use Plugin?
- 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
- Plugin hook breaks new WP 4.0 media library grid view?
- How to get site homepage from plugin?
- Unable to show 4 products in a row
- Is an Office a custom post type [closed]
- How to add image for custom taxonomy
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- wordpress Ajax success doesn’t return the value
- Meta box not displaying on the plugin page
- public custom posts not showing in my wordpress plugin
- Allow manage_options capability for specific user only for specific plugin?