This will depend on if you’re looking at retrieve it by its file level path or its URL.
I typically use the following:
plugins_url( 'widget-name/assets/images/admin.png' )
Try that – if it doesn’t work, let me know!
Hey Tom!
I’m thinking more so by its file level path. Let me explain a little bit more in-depth the widget I’ve created and perhaps that might help make sense of which route to take..
The widget is VERY simple. It is just a textarea where the user can enter in information. The box that is built in the sidebar houses a div with a background image. I’m referencing a stylesheet within the widget plugin to retrieve the styles for this div – however the background images only work if I use the exact path to their location (i.e. the full website url) … I basically want to make this all “relative” so that I can recycle this plugin on other sites I have, so using the absolute path to the image wont work.
I’m sure this is more of a file path/structure issue or even a css thing more than anything..
Have I confused you?
OH I’m dumb. haha you’re right. Sorry. Thank you!
Guess I need more coffee…