Advertisement
fauzanjeg

By Pass Premium Posts by Roles

Oct 25th, 2022
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. /**
  2.  * JNEWS Custom, Exclude Subscription Users by Roles
  3.  *
  4.  * @param array $roles Default is administrator.
  5.  *
  6.  * @return array $roles
  7.  */
  8. function jcustom_exclude_subscription_users_by_roles( $roles ) {
  9.     /** List Role (Defaults): administrator, editor, author, contributor, subscriber */
  10.     $roles[] = 'author'; /** Single Add */
  11.     // $roles   = array_merge( $roles, array( 'editor', 'contributor' ) ); /** Multiple Add */
  12.  
  13.     return $roles;
  14. }
  15. add_filter( 'jnews_paywall_unaffected_role_list', 'jcustom_exclude_subscription_users_by_roles' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement