Skip to content

Instantly share code, notes, and snippets.

@ericakfranz
Forked from n7studios/soliloquy-inject-slides.php
Last active August 29, 2015 14:15
Show Gist options
  • Save ericakfranz/32ad2f8ccea42946d5b7 to your computer and use it in GitHub Desktop.
Save ericakfranz/32ad2f8ccea42946d5b7 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Soliloquy - Inject Slides
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Disable touchswipe on mobile
*/
/**
* Inject slides to a specific slider
*/
function soliloquy_inject_slides( $data, $slider_id ) {
// Only apply to slider ID 467
if ( $slider_id != 467) {
return $data;
}
// Inject Image Slide
$data['slider']['custom-1000'] = array(
'id' => 'custom-1000',
'status'=> 'active',
'src' => 'http://placehold.it/900x900',
'title' => 'Custom Image Slide',
'link' => 'http://soliloquywp.com',
'alt' => 'Placehold Image',
'caption'=> 'Placehold Caption',
);
return $data;
}
add_filter( 'soliloquy_pre_data', 'soliloquy_inject_slides', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment