Skip to content

Instantly share code, notes, and snippets.

@thomasgriffin
Created February 18, 2015 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasgriffin/984c3e2dfa4b7bc24578 to your computer and use it in GitHub Desktop.
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.
<?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