daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Dec 15th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. PMPro Lock Membership Levels-lock existing members. Add this to your customizations plugin and refresh the page. Recommend deleting the code snippet after the operation is complete.
  3. */
  4. function bulk_lock_all_members()
  5. {
  6.     global $wpdb;
  7.     $users = $wpdb->get_results( "SELECT ID FROM $wpdb->users" );
  8.     if( $users ) {
  9.       foreach ( $users as $user ) {
  10.         update_user_meta( $user->ID, 'pmprolml', 1 );
  11.       }
  12.     }
  13. }
  14.  
  15. add_action( "init", "bulk_lock_all_members", 10, 0 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top