Skip to content

Instantly share code, notes, and snippets.

@avioli
Created August 5, 2015 06:23
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 avioli/f32e3d4245b8d09ac04b to your computer and use it in GitHub Desktop.
Save avioli/f32e3d4245b8d09ac04b to your computer and use it in GitHub Desktop.
<?php
$user_roles_option_name = 'custom-user-roles-version';
$user_roles_version = '0.1.0';
$user_roles_current_version = get_option($user_roles_option_name);
if ($user_roles_current_version && version_compare($user_roles_current_version, $user_roles_version) >= 0) {
return;
}
error_log('NOTE: USER CAPABILITIES UPDATE');
update_option($user_roles_option_name, $user_roles_version);
// add_role(...);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment