function meta_shortcode_pieces($atts)
 {
     $pieces = parent::meta_shortcode_pieces($atts);
     extract(shortcode_atts(array('show' => "date", 'date_string' => '%s', 'date_formatter' => array('Press_News_Events', 'date_i18n')), $atts));
     $show = explode(' ', $show);
     $post = get_post(get_the_ID());
     $pieces[] = sprintf($date_string, call_user_func($date_formatter, $post->post_date));
     return $pieces;
 }
 function meta_shortcode_pieces($atts)
 {
     $pieces = parent::meta_shortcode_pieces($atts);
     extract(shortcode_atts(array('show' => "link date", 'date_formatter' => array('Press_News_Events', 'date_i18n')), $atts));
     $show = explode(' ', $show);
     $meta = get_post_custom(get_the_ID());
     extract(array('link' => isset($meta['_link'][0]) ? $meta['_link'][0] : '', 'date' => isset($meta['_date'][0]) ? $meta['_date'][0] : ''));
     if ($link && in_array('link', $show)) {
         $pieces[] = sprintf('<a href="%1$s">%1$s</a>', $link);
     }
     //		if ($date && in_array('date', $show)) $pieces[] = call_user_func($date_formatter, $date);
     // This actually returns the date entered from the date picker:
     if ($date && in_array('date', $show)) {
         $pieces[] = date('l, jS F Y', $date);
     }
     return $pieces;
 }
Exemple #3
0
 function meta_shortcode_pieces($atts)
 {
     $pieces = parent::meta_shortcode_pieces($atts);
     extract(shortcode_atts(array('show' => "link date", 'date_formatter' => array('Press_News_Events', 'date_i18n')), $atts));
     $show = explode(' ', $show);
     $meta = get_post_custom(get_the_ID());
     extract(array('link' => $meta['_link'][0], 'date' => $meta['_date'][0]));
     if ($link && in_array('link', $show)) {
         $pieces[] = sprintf('<a href="%1$s">%1$s</a>', $link);
     }
     if ($date && in_array('date', $show)) {
         $pieces[] = call_user_func($date_formatter, $date);
     }
     return $pieces;
 }
 function meta_shortcode_pieces($atts)
 {
     $pieces = parent::meta_shortcode_pieces($atts);
     extract(shortcode_atts(array('show' => "location date", 'location_string' => _x("at <span class='location'>%s</span>", "(an event being held) at [location name]", 'press-news-events'), 'date_string' => '%s', 'date_formatter' => array('Press_News_Events', 'pretty_date_range')), $atts));
     $show = explode(' ', $show);
     $meta = get_post_custom(get_the_ID());
     extract(array('location' => $meta['_location'][0], 'starts' => $meta['_starts'][0], 'ends' => $meta['_ends'][0], 'all_day' => $meta['_all_day'][0]));
     if (in_array('location', $show) && !empty($location)) {
         $pieces[] = sprintf($location_string, $location);
     }
     if (in_array('date', $show) && $starts) {
         $pieces[] = sprintf($date_string, call_user_func($date_formatter, $starts, $ends, $all_day));
     }
     return $pieces;
 }