Last active
March 7, 2017 20:51
-
-
Save PauliusKrutkis/5589d1af63e34b28e200bd39897d2ce2 to your computer and use it in GitHub Desktop.
Wordpress - change content attachment html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function editMediaTemplate($html) | |
{ | |
$class = 'attachment-link'; | |
return str_ireplace('<a href', sprintf('<a class="%s" href', $class), $html); | |
} | |
add_filter('media_send_to_editor', 'editMediaTemplate', 20, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment