JavaScript for WordPress Forums Gutenberg Development Getting resources from plugin

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #55527
    chrisdavies71
    Participant

    Hi Zac,

    I am trying to get an image file (as a resource) into my block.

    Here is the code i currently have which as you can see has a hard coded link to the file:

    edit: function( props ) {
    		// Creates a <p class='wp-block-cgb-block-cp-current-rms-plugin'></p>.
    		return (
    			<div className={ props.className }>
    				<img className="currentlogo" src="../wp-content/plugins/Current-RMS-for-Wordpress-Gutenberg/dist/current-rms-logo.png"></img>
    			</div>
    		);
    	},

    Is it possible to use something like plugin_dir_path? If so how would i do it?

    Regards

    CHRIS

    #55544
    Zac Gordon
    Keymaster
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.