Last active
August 29, 2015 14:19
-
-
Save ericakfranz/b5780d579054c9f604a1 to your computer and use it in GitHub Desktop.
Soliloquy titled caption plugin.
This file contains hidden or 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 | |
/** | |
* Plugin Name: Soliloquy Titled Caption | |
* Plugin URI: http://soliloquywp.com/ | |
* Description: Customizes the Soliloquy caption output to show the title before the caption text. | |
* Version: 1.0.0 | |
* Author: Erica Franz | |
* Author URI: https://fatpony.me | |
*/ | |
defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); | |
add_filter( 'soliloquy_output_caption', 'soliloquy_title_before_caption', 10, 5 ); | |
function soliloquy_title_before_caption( $caption, $id, $slide, $data, $i ) { | |
// Check if current slide has a title specified | |
if ( isset( $slide['title'] ) && !empty( $slide['title'] ) ) { | |
$caption = '<h4 class="title">' . $slide['title'] . '</h4>'; | |
$caption .= '<div class="caption">' . $slide['caption'] . '</div>'; | |
} | |
return $caption; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment