Advertisement
designbymerovingi

Sell Content: Add Price to Insufficient Template

Sep 26th, 2016
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. /**
  2.  * Add Price to Insufficient Template
  3.  * @version 1.0
  4.  */
  5. function mycred_pro_add_price_to_insufficient_template( $template, $post, $type ) {
  6.  
  7.     $user_id  = get_current_user_id();
  8.     $price    = mycred_get_content_price( $post->ID, $type, $user_id );
  9.  
  10.     $template = str_replace( '%price%', $price, $template );
  11.  
  12.     return $template;
  13.  
  14. }
  15. add_filter( 'mycred_sell_content_template', 'mycred_pro_add_price_to_insufficient_template', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement