Home / Archive / MemberPress: Free-Views-Used Counter
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Free-Views-Used Counter

This code will add the counter notification showing users how many free views of the paywall they have used so far.

Code Preview
php
<?php
function mepr_display_cookie() {
  $free_views = isset( $_COOKIE['mp3pi141592pw']) ? base64_decode( $_COOKIE['mp3pi141592pw'] ) : false;
  if( $free_views !== false ) {
    echo 'You used ' . $free_views . ' free views!';
  }
}
add_action( 'init', 'mepr_display_cookie' );

Comments

Add a Comment