Guest User

Untitled

a guest
Dec 15th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  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 );
Add Comment
Please, Sign In to add comment