Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Last active February 16, 2016 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annalinneajohansson/c9abd92438c8dc19ea7b to your computer and use it in GitHub Desktop.
Save annalinneajohansson/c9abd92438c8dc19ea7b to your computer and use it in GitHub Desktop.
<?php
$storeids = array();
foreach( $store_merchants as $merchantID ){
$storeid = get_user_meta( $merchantID, 'kostnadsstalle', true );
$storeids[$storeid] = $merchantID;
}
asort( $storeids );
$lastid = end( $storeids );
if ( 1 < count( $store_merchants ) ) {
if( $lastid != $wp_user->ID ) {
update_user_meta( $wp_user->ID, 'retired', 1 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment