# 如何禁用 Cakeday？

**URL:** https://meta.discourse.org/t/how-can-i-disable-cakeday/130758
**Category:** Support
**Created:** [2019年十月11日 07:03 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758 "2019-10-11T07:03:16Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![\_alejandro](https://avatars.discourse-cdn.com/v4/letter/_/958977/32.png) [@\_alejandro](https://meta.discourse.org/u/_alejandro)
#### Post date: [2019年十月11日 07:03 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/1 "2019-10-11T07:03:16Z")

</div>

我想禁用生日和纪念日，并且不希望用户能够选择他们的出生日期。我该如何操作？

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2019年十月11日 07:07 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/2 "2019-10-11T07:07:25Z")

</div>

如果您已安装该插件，只需从您的 YML 文件中移除它并重新构建即可。

---

<div class="post-metadata">

### Author: ![\_alejandro](https://avatars.discourse-cdn.com/v4/letter/_/958977/32.png) [@\_alejandro](https://meta.discourse.org/u/_alejandro)
#### Post date: [2019年十月11日 07:08 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/3 "2019-10-11T07:08:41Z")

</div>

我无法移除该插件 ☹

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [2019年十月11日 07:10 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/4 "2019-10-11T07:10:56Z")

</div>

在`Admin > Settings`中搜索 cakeday，然后禁用该设置：⬇

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/b/fb3535d021b4b3f8023c59921a32b5e776f354ba.png)

---

<div class="post-metadata">

### Author: ![\_alejandro](https://avatars.discourse-cdn.com/v4/letter/_/958977/32.png) [@\_alejandro](https://meta.discourse.org/u/_alejandro)
#### Post date: [2019年十月11日 07:12 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/5 "2019-10-11T07:12:16Z")

</div>

这会把“纪念日”从主菜单中隐藏吗？🙂

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2019年十月11日 08:23 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/6 "2019-10-11T08:23:05Z")

</div>

不行，但你可以通过以下方式将 Cakeday 链接隐藏在汉堡菜单中：

```css
.widget-link.cakeday-link {
    display: none !important;
}

```

并通过以下方式隐藏用户个人资料中的出生日期字段：

```css
.user-custom-preferences-outlet.user-date-of-birth-input {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年十月11日 08:58 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/7 "2019-10-11T08:58:02Z")

</div>

如果您从 app.yml 中删除该行，会发生什么？

---

<div class="post-metadata">

### Author: ![\_alejandro](https://avatars.discourse-cdn.com/v4/letter/_/958977/32.png) [@\_alejandro](https://meta.discourse.org/u/_alejandro)
#### Post date: [2019年十月11日 13:35 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/8 "2019-10-11T13:35:55Z")

</div>

为什么第一个有“!important”，而第二个没有？🙂

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2019年十月11日 13:56 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/9 "2019-10-11T13:56:12Z")

</div>

因为在第一种情况下，我必须让 CSS 明白，我现在声明的 `display` 属性比默认样式表中已为该元素先前声明的现有属性具有更高的优先级。

```css
.menu-panel li a.widget-link, .menu-panel li.heading a.widget-link {
    display: block;
}

```

---

<div class="post-metadata">

### Author: ![\_alejandro](https://avatars.discourse-cdn.com/v4/letter/_/958977/32.png) [@\_alejandro](https://meta.discourse.org/u/_alejandro)
#### Post date: [2019年十月11日 13:57 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/10 "2019-10-11T13:57:34Z")

</div>

感谢解释！

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019年十一月10日 14:02 UTC](https://meta.discourse.org/t/how-can-i-disable-cakeday/130758/11 "2019-11-10T14:02:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
