Pour votre fichier functions.php ou un plugin de fonctionnalité:
function html5_insert_image($html, $id, $caption, $title, $align, $url) ( $html5 = " "; $html5 .= "
"; if ($caption) ( $html5 .= "
$caption
"; ) $html5 .= "
"; return $html5; ) add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );
Il prend également ce que vous entrez comme légende et l'insère dans le
. Exemple de code inséré:
Caption for image