Use plugin_dir_url()
to get the public URI for the directory where the calling PHP file is.
<img src="https://wordpress.stackexchange.com/questions/60230/<?php echo plugin_dir_url( __FILE__ ) ."images/facebook.png'; ?>">
If the PHP file is in a sub directory of your plugin you have to go up:
<img src="https://wordpress.stackexchange.com/questions/60230/<?php echo plugin_dir_url( dirname( __FILE__ ) ) ."images/facebook.png'; ?>">
Related Posts:
- Symbolic Links on dev box with plugins and stylesheets
- How to add multiple custom URL variables?
- How to Rewrite WordPress URL for a Plugin
- Having Problem On Getting WP Post Gallery Images URL
- Mapping multiple URLs to same page
- URLs of plugin resources?
- plugin_dir_url() adds path to url
- How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as “page” in WP 5.5?
- Access bloginfo, get_option, and plugins_url from a non-core php file
- Can I use %category% like Templates in my Plugin?
- How to list all images used on a specific page?
- The URL of images on my website changed after being set as featured image
- How to save page URL as a favorite
- Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial
- Check current URL is 404 in pre_option_stylesheet filter hook
- Creating a return url for getting data from external api
- Return raw image proxy for wordpress plugin
- How to pass a more variable with page/subpage in Wordprees URL?
- Plugins and how to assign urls to content
- Any way to make Apache’s internal redirect work?
- Issue on Getting Images URL of the Post Gallery
- Mapping multiple URLs to same page
- How to Rewrite WordPress URL for a Plugin
- How to Rewrite WordPress URL for a Plugin
- redirect word-press page with page values
- WordPress custom link with my plugin
- Personalized URL for non-logged in WordPress
- esc_url, esc_url_raw or sanitize_url?
- How Do I Use jQuery UI In My Plugin
- Checking if a file is already in the Media Library
- Which action for triggering cron “wp”or “init”?
- WordPress and multithreading
- What’s the difference between hooks, filters and actions? [duplicate]
- How to duplicate custom menu settings to export to another site
- update_option_{$option} Too Few Arguments
- How to post form in ajax mode and handle it in wordpress
- Check if on Custom Post Type for TinyMCE buttons
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- WordPress restrict plugin file direct access
- How to check active theme is parent or child wordpress
- Example of uninstaller routine to remove all custom theme options from wp_options
- What is the use of get_option method
- how to use preg_replace for wordpress video?
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Plugin development: get_post_meta is not working [closed]
- Correct way check nonce (security) using old Options API
- URL parsing – what is it?
- How to run an add_action hook for specific page
- Is it possible to use add_filter from a theme to alter a plugin’s function?
- How do I dynamically render an InnerBlock inside a dynamic block?
- wp_insert_category() setting the ‘cat_ID’ gives not array error
- How can I limit the amount of characters used for description in the manage categories grid?
- How to filter the_content() & include content from template
- Asynchronously render shortcodes in TinyMCE visual editor
- Add a select option of shortcodes like dropdown in tinymce
- Open modal when user clicks on span in visual editor
- How to paginate a custom page template with custom database tables
- wp_mail() headers multipart/alternative
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Run JavaScript validation script on form submit in plugin
- How to add plugin options in wp editor page
- Bypass product key [closed]
- Return conditional category in load_posts_by_ajax
- How to format custom fields when editing an attachment?
- Woocommerce – Provide Associated Category Link for Product List Plugin [closed]
- How can I call wp-load.php in my plugin file
- How to create new content type and flushes rewrite rules without visiting the permalinks page?
- About a programming language starts with [closed]
- How to Get Last ID?
- Custom Block Not Shown in Block Inserter
- How to display specific data from a custom table to logged in users with a custom role
- add_filter postbox_classes multiple post types
- How to add quick edit on the list of users to edit custom fields?
- How to Run Plugin on Server Without Web Browser
- Impossible to declare box-shadow with wp.customize?
- WP Refused to display ‘URL’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
- Unit Testing action hook
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- delete category on plugin deactivation wordpress
- Rate limiting ajax requests in WordPress
- Integrate separate web app inside wordpress [closed]
- How to filter an action inside class in MemberPress plugin?
- PHP includes with AJAX actions
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- Define a url for an email confirmation from within a plugin
- WordPress Search Form with Keyword Suggestion
- Custom Post Type and Functions
- WordPress custom plugin developement
- Google does not index data from custom table used for a plugin
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- I can install my plugin in localhost but not in my server
- ouput buffering confusing me!
- WordPress.org how to force expire Cached Banner-772×250 from my Plugin page
- What is the Timeline for the Active Version Pie Chart in the Repository?
- Email verification feature in wordpress social login plugin
- append code after the_content not working
- Custom Pin it button is not showing over the image instead it shows as block top_left
- check wp_login into a plugin
- I want to redirect user to an amazon product page from my wordpress website when they add product to there cart [closed]