Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. /**
  2. * Takes a normal Image URL,
  3. * gets the absolute path and includes it via PHP
  4. * For use with SVG embeds
  5. *
  6. * @param String $image_url URL to the attachement
  7.  
  8. */
  9. function inline_svg_embed( $image_url ) {
  10.  
  11. if ( false !== strpos( $image_url, '.svg' ) ) :
  12.  
  13. $image_url = str_replace( site_url(), '', $image_url);
  14.  
  15. include( ABSPATH . $image_url );
  16.  
  17. endif;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement