Skip to content

Instantly share code, notes, and snippets.

@ronalfy
Created February 24, 2020 17:51
Show Gist options
  • Save ronalfy/bd3e2c0bf6405146ad66fd379a5b3d5a to your computer and use it in GitHub Desktop.
Save ronalfy/bd3e2c0bf6405146ad66fd379a5b3d5a to your computer and use it in GitHub Desktop.
PMPro Limit Pages Add On for Protecting Posts
<?php
function pmpro_lpv_add_my_post_types( $post_types ) {
$post_types[] = 'post';
// Add pages to post type array to restrict Limit Post Views.
$post_types[] = 'page';
// $post_types[] = 'custom-post-type'; | Example of how you can add more $post_types
return $post_types;
}
add_filter( 'pmprolpv_post_types', 'pmpro_lpv_add_my_post_types', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment