Created
February 18, 2015 15:14
-
-
Save thomasgriffin/984c3e2dfa4b7bc24578 to your computer and use it in GitHub Desktop.
Updates all slides in all sliders and sets the status to active in Soliloquy.
This file contains 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 | |
add_action( 'wp_loaded', 'tgm_soliloquy_set_slides_to_published' ); | |
function tgm_soliloquy_set_slides_to_published() { | |
if ( ! class_exists( 'Soliloquy' ) ) { | |
return; | |
} | |
$sliders = Soliloquy::get_instance()->_get_sliders(); | |
foreach ( (array) $sliders as $slider ) { | |
if ( isset( $slider['slider'] ) ) { | |
foreach ( (array) $slider['slider'] as $id => $item ) { | |
$slider['slider'][ $id ]['status'] = 'active'; | |
} | |
} | |
update_post_meta( $slider['id'], '_sol_slider_data', $slider ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment