Created
July 29, 2015 18:46
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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