/ Published in: PHP

Allows a SlideDeck user to hook into the options array after the SlideDeck is fetched from the database. Options can then be modified based on the request.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Hook-in to slidedeck_after_get filter * * @return array */ function slidedeck_after_get( $slidedeck ) { global $SlideDeckPlugin; /** * For this example, I'm fetching the twitter handle from the request URI, but * you could get this from custom post meta or another source too. */ $twitter_handle = (string) $_REQUEST['twitter_handle']; // Specify the SlideDeck ID or this will affect all decks! if( $slidedeck['id'] == 48842 ) { $slidedeck['options']['twitter_username'] = $twitter_handle; } return $slidedeck; } add_action( 'slidedeck_after_get', 'slidedeck_after_get' );
Comments
