Skip to content

Instantly share code, notes, and snippets.

View zaacwilliam1's full-sized avatar

Ogunsipe Oluwaseun Isaac (zaacwilliam) zaacwilliam1

View GitHub Profile
<?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);
<?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())
{