Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "return' to fix error #62

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/restriction.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ function pmprolpv_get_restriction_js() {
// Check if we want to allow free views for this post type.
$post = get_post( $post_id );
if ( ! pmprolpv_allow_free_views_for_post( $post ) ) {
wp_send_json_success( 'return;' );
wp_send_json_success( '' );
}

// Unhook the LPV has_access filter to see if the user truly has access to this post.
remove_filter( 'pmpro_has_membership_access_filter', 'pmprolpv_has_membership_access_filter', 10, 2 );

// Check if the user has access to the post.
if ( pmpro_has_membership_access( $post_id ) ) {
wp_send_json_success( 'return;' );
wp_send_json_success( '' );
}

// The user should not have access to this post. Check if they still have LPV views remaining.
Expand Down
Loading