/** * Returns custom meta. * * @param string $meta_id The meta group this is in. * @return string The custom meta. * @author Timothy Wood * @since 3.0 */ public static function custom_meta($meta_id) { global $_tribe_meta_factory; $fields = tribe_get_custom_fields(get_the_ID()); $custom_meta = ''; foreach ($fields as $label => $value) { $custom_meta .= Tribe_Meta_Factory::template($label, $value, $meta_id); } return apply_filters('tribe_event_pro_meta_custom_meta', $custom_meta); }
/** * Get the venue map * * @param int $meta_id * @return string */ public static function venue_map($meta_id) { global $_tribe_meta_factory; $post_id = get_the_ID(); $map = tribe_get_embedded_map($post_id); $venue_map = empty($map) ? '' : Tribe_Meta_Factory::template($_tribe_meta_factory->meta[$meta_id]['label'], $map, $meta_id); return apply_filters('tribe_event_meta_venue_map', $venue_map); }
/** * Get the meta. * * @param $meta_id * @param bool $is_the_meta * @return bool|mixed|void * @since 3.0 */ 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_Meta_Factory::check_exists($meta_id)) { return false; } $meta = Tribe_Meta_Factory::get_args($meta_id); // internal check for hiding items in the meta // if( $is_the_meta && ! $meta['show_on_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_Meta_Factory::template($meta['label'], $value, $meta_id) : ''; return apply_filters('tribe_get_meta', $html, $meta_id); }