Created
August 14, 2017 09:09
-
-
Save gabrielmerovingi/83c2c9f6fb2bd71a3aa5a751a65d0c93 to your computer and use it in GitHub Desktop.
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
function mycred_pro_maybe_hide_message_charge( $content ) { | |
// Only applicable to texts starting with New Reply: | |
if ( substr( $content, 0, 10 ) == 'New Reply:' && function_exists( 'bp_loggedin_user_id' ) ) { | |
$user_id = bp_loggedin_user_id(); | |
// If a user does not the bp_charges_pay capability | |
// hide the message | |
if ( ! user_can( 'bp_charges_pay', $user_id ) ) | |
return ''; | |
} | |
return $content; | |
} | |
add_filter( 'mycred_parse_tags_general', 'mycred_pro_maybe_hide_message_charge' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment