I'm writing a custom plugin for someone, but I ran into a bit of a problem...
I'm trying to use WordPress's Shortcodes feature to replace [DoIt month=”12″ day=”01″ year=”2008″ hour=”00″ minute=”00"] with a custom message (that was easy) and retrieve the attributes for use elsewhere in the script.
Basically I have
function ck_shortcode($atts) {
extract(shortcode_atts(array('month', 'day', 'year', 'hour' => '00','minute' => '00'), $atts));
return '<p>Deadline: '.$atts['day'].':'.$atts['month'].':'.$atts['year'].':'.$atts['hour'].':'.$atts['minute'].'</p>';
}
and am trying to get the $atts array out of the function, so I can reference it elsewhere in the script. Sort of a "reverse global variable." Does anyone know how to do this?