Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Created April 10, 2015 18:36
Show Gist options
  • Save ericakfranz/34b427c21146bac286f7 to your computer and use it in GitHub Desktop.
Save ericakfranz/34b427c21146bac286f7 to your computer and use it in GitHub Desktop.
Automatically wrap each Soliloquy caption text line in a paragraph tag.
add_filter( 'soliloquy_output_item_data', 'ekf_filter_caption_paragraph_tags', 10, 3 );
function ekf_filter_caption_paragraph_tags( $image, $id, $data) {
// Wrap the image caption text in paragraph tags
$image['caption'] = wpautop( $image['caption'] );
// Return the modified data.
return $image;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment