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 | |
add_action( 'template_redirect', 'view-content' ); | |
function view-content{ | |
if ( is_singular( 'post' ) ) { | |
//your code here... | |
if(is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel()) | |
{ | |
global $current_user; | |
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID); |
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 | |
add_action('transition_comment_status', 'my_approve_comment_callback', 10, 3); | |
function my_approve_comment_callback($new_status, $old_status, $comment) { | |
if($old_status != $new_status) { | |
if($new_status == 'approved') { | |
// Your code here | |
if(is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel()) | |
{ |