Created
April 21, 2016 01:28
-
-
Save oneblackcrayon/7300ca3f454718fc168e1c05fd0938f3 to your computer and use it in GitHub Desktop.
Soliloquy: Completely bypass output into a slider. Simply use Soliloquy for the UI and then do something completely different with it. And here is how you do it. Using this filter will completely disable any slider output, including CSS and JS files and initializations. It gives you a blank slate with nothing but raw images (in the $images array…
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
add_filter( 'tgmsp_pre_load_slider', 'tgm_soliloquy_transform_to_gallery', 10, 5 ); | |
/** | |
* Circumvents the slider output and allows access to raw format. | |
* | |
* @param bool $bool Boolen if the filter should be run. Default is false. | |
* @param int $id The slider ID being filtered. | |
* @param array $images Array of images in the slider. | |
* @param array $data Array of meta for the slider. | |
* @param int $count The current number of the slider on page (if there is more than one on the page). | |
* @return bool|string False if you want to keep a slider, HTML output for something else. | |
*/ | |
function tgm_soliloquy_transform_to_gallery( $bool, $id, $images, $data, $count ) { | |
// Prepare your $gallery variable. All gallery HTML will be stored in here. | |
$gallery = ''; | |
// Make all HTML stuff happen here. | |
// Return the $gallery variable to be output by Soliloquy. | |
return $gallery; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment