20) { add_settings_error('authcode_settings', 'authcode_code', 'Authentication code cannot be longer than 20 characters.', $type = 'error'); return false; } elseif(strlen($options['code']) < 3) { add_settings_error('authcode_settings', 'authcode_code', 'Authentication code cannot be shorter than 3 characters.', $type = 'error'); return false; } else { add_settings_error('authcode_settings', 'authcode_code', 'Settings saved.', $type = 'updated'); } } else { add_settings_error('authcode_settings', 'authcode_code', 'Authentication code has been disabled.', $type = 'updated'); } } return $options; } add_action('admin_notices', 'authcode_admin_notices'); function authcode_admin_notices() { settings_errors(); } function authcode_page() { ?>