Created
December 19, 2022 15:05
-
-
Save thierrypigot/6d75d145db1945d0d2ed0750d4717516 to your computer and use it in GitHub Desktop.
Ajouter ou modifier des éléments dans le code HTML généré par WordPress
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 ajout_attribut_lien($text) { | |
$text = preg_replace('/(<a.*?)(>)/','$1 target="_blank"$2',$text); | |
return $text; | |
} | |
add_filter('the_content','ajout_attribut_lien'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment