Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created July 23, 2015 20:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barryhughes/21c4e2fc52aec514cc9c to your computer and use it in GitHub Desktop.
Save barryhughes/21c4e2fc52aec514cc9c to your computer and use it in GitHub Desktop.
<?php
/**
* Returns the contents of the event cost field without applying any
* formatting tricks.
*
* Useful in those cases where a non-standard cost values such as
* "ABC-123" is used, else they may be "mangled" by the
* Tribe__Events__Cost_Utils object.
*
* @param string $cost (unused)
* @param int $post_id
* @return string
*/
function verbatim_cost_field( $cost, $post_id ) {
return esc_html( get_post_meta( $post_id, '_EventCost', true ) );
}
add_filter( 'tribe_get_cost', 'verbatim_cost_field', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment