Skip to content

Instantly share code, notes, and snippets.

@scottlyttle
Created May 17, 2013 03:53
Show Gist options
  • Save scottlyttle/5596829 to your computer and use it in GitHub Desktop.
Save scottlyttle/5596829 to your computer and use it in GitHub Desktop.

Revisions

  1. scottlyttle created this gist May 17, 2013.
    10 changes: 10 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    function html5_insert_image($html, $id, $caption, $title, $align, $url) {
    $html5 = "<figure id='post-$id media-$id' class='align-$align'>";
    $html5 .= "<img src='$url' alt='$title' />";
    if ($caption) {
    $html5 .= "<figcaption>$caption</figcaption>";
    }
    $html5 .= "</figure>";
    return $html5;
    }
    add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );