Closed VidYen closed 5 years ago
https://codex.wordpress.org/Function_Reference/plugins_url
<?php
echo '<img src="' . plugins_url( 'images/wordpress.png', __FILE__ ) . '" > ';
?>
The above might ouput this HTML markup: <img src="http://www.example.com/wp-content/plugins/my-plugin/images/wordpress.png">.
If you are using the plugins_url() function in a file that is nested inside a subdirectory of your plugin directory, you should use PHP's dirname() function:
<?php
echo '<img src="' . plugins_url( 'images/wordpress.png', dirname(__FILE__) ) . '" > ';
?>
The above might ouput this HTML markup: <img src="http://www.example.com/wp-content/plugins/images/wordpress.png">.
I'm 60% sure this was fixe as when i looked at it it was.
Mika pointed out this issue in VidHash
plugins_url( '../vidyen-vidhash/images/vyworker_001.gif', __FILE__ )
I should get around to fixing the VYPS. I do not remember why i had the ../(pluginname)