Created
August 8, 2013 00:28
-
-
Save JoeHana/6180318 to your computer and use it in GitHub Desktop.
Replace price with custom field
This file contains hidden or 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 | |
/** | |
* Replace price with custom field | |
*/ | |
add_filter( 'ts_currency_price', 'custom_property_price' ); | |
function custom_property_price( $price ) { | |
$post_id = get_the_ID(); | |
// Get text before price | |
$price_label = get_post_meta( $post_id, 'price_label', true ); | |
if( $price_label ) | |
return $price_label; | |
return $price; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment