Guest User

Untitled

a guest
Jul 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. /**
  2. * Customize Sell Content Prices
  3. * @mycred
  4. * @version 1.0
  5. */
  6. add_filter( 'mycred_get_content_price', 'mycred_pro_custom_content_price', 10, 4 );
  7. function mycred_pro_custom_content_price( $price, $post_id, $point_type, $user_id ) {
  8.  
  9. // If the user is an author
  10. if ( user_can( $user_id, 'edit_published_posts' ) ) {
  11.  
  12. // Get our custom price that we stored as a custom post meta
  13. $custom_price = get_post_meta( $post_id, 'custom_price', true );
  14. if ( $custom_price != '' )
  15. $price = $custom_price;
  16.  
  17. }
  18.  
  19. return $price;
  20.  
  21. }
Add Comment
Please, Sign In to add comment