Ejemplo n.º 1
0
 /**
  * Get the meta.
  *
  * @param      $meta_id
  * @param bool $is_the_meta
  *
  * @return bool|mixed|void
  */
 function tribe_get_meta($meta_id, $is_the_meta = false)
 {
     do_action('tribe_get_meta', $meta_id, $is_the_meta);
     // die silently if the requested meta item is not registered
     if (!Tribe__Events__Meta_Factory::check_exists($meta_id)) {
         return false;
     }
     $meta = Tribe__Events__Meta_Factory::get_args($meta_id);
     // internal check for hiding items in the meta
     if (!$meta['show_on_meta']) {
         return false;
     }
     $params = array($meta_id);
     if (!empty($meta['filter_callback'])) {
         return call_user_func_array($meta['filter_callback'], $params);
     }
     if (!empty($meta['callback'])) {
         $value = call_user_func_array($meta['callback'], $params);
     }
     $value = empty($value) ? $meta['meta_value'] : $value;
     // if we have a value let's build the html template
     $html = !empty($value) ? Tribe__Events__Meta_Factory::template($meta['label'], $value, $meta_id) : '';
     return apply_filters('tribe_get_meta', $html, $meta_id);
 }
Ejemplo n.º 2
0
 /**
  * Returns custom meta.
  *
  * @deprecated since 3.6
  *
  * @param string $meta_id The meta group this is in.
  *
  * @return string The custom meta.
  */
 public static function custom_meta($meta_id)
 {
     _deprecated_function(__METHOD__, '4.3');
     $fields = tribe_get_custom_fields(get_the_ID());
     $custom_meta = '';
     foreach ($fields as $label => $value) {
         $custom_meta .= Tribe__Events__Meta_Factory::template($label, $value, $meta_id);
     }
     return apply_filters('tribe_event_pro_meta_custom_meta', $custom_meta);
 }
 /**
  * Get the venue map
  *
  * @deprecated 4.3
  *
  * @param int $meta_id
  *
  * @return string
  */
 public static function venue_map($meta_id)
 {
     _deprecated_function(__METHOD__, '4.3');
     global $_tribe_meta_factory;
     $post_id = get_the_ID();
     $map = tribe_get_embedded_map($post_id);
     $venue_map = empty($map) ? '' : Tribe__Events__Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $map, $meta_id);
     return apply_filters('tribe_event_meta_venue_map', $venue_map);
 }