Guest User

info_event_spec.php

a guest
May 14th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. <?php
  2.  
  3. $custom_metabox = $info_eventos_mb = new WPAlchemy_MetaBox(array
  4. (
  5.     'id' => '_info_eventos_meta',
  6.     'title' => 'Informa&ccedil;&otilde;es do Evento',
  7.     'types' => array( 'eventos' ),
  8.     'context' => 'side',
  9.     'mode' => WPALCHEMY_MODE_EXTRACT,
  10.     'template' => get_stylesheet_directory() . '/metaboxes/info-eventos-meta.php',
  11.     'prefix' => '_info_evento_',
  12.     'save_filter' => 'save_datetime'
  13. ));
  14.     function save_datetime($meta, $post_id) {
  15.        // var_dump($meta);
  16.         //var_dump($post_id);
  17.         //exit;
  18.            
  19.         $dd = $meta['start_day'];
  20.         $mm = $meta['start_month'];
  21.         $yy = $meta['start_year'];
  22.         $hh = $meta['start_hour'];
  23.         $mn = $meta['start_minute'];
  24.         $start_datetime = strtotime( $dd . $mm . $yy . $hh . $mn );
  25.  
  26.         //$meta['start_datetime'] = $start_datetime;
  27.         update_post_meta($post_id, '_info_evento_start_datetime', $start_datetime);
  28.  
  29.        return $meta;
  30.    }
  31. /* eof */
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment