Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Created July 29, 2015 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseeproductions/914b68ce570cca31c075 to your computer and use it in GitHub Desktop.
Save jesseeproductions/914b68ce570cca31c075 to your computer and use it in GitHub Desktop.
Returns the contents of the event cost field without applying any formatting tricks.
<?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