Skip to content

Instantly share code, notes, and snippets.

@n7studios
Created February 11, 2015 18:58
Show Gist options
  • Save n7studios/8abf716cbf413daaecdc to your computer and use it in GitHub Desktop.
Save n7studios/8abf716cbf413daaecdc to your computer and use it in GitHub Desktop.
Soliloquy - Inject Slides
<?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