It seems I can use the same class that inherits from Command to override the QueryState method. This is called when the buttons load, and I can check there and return CommandState.Hidden if the button should not be displayed
public override CommandState QueryState(CommandContext context) { var item = context.Items[0]; return item.Fields["Spotlight"].Value == "" ? CommandState.Hidden : base.QueryState(context); }
source share