如何在 hook_form_alter 上添加权重

发布于 2024-12-13 12:23:25 字数 131 浏览 5 评论 0原文

我的模块中有一个 hook_form_alter,但另一个模块 workbench_access 也有一个 hook_form_alter,我需要在 hook_form_alter 之前调用它。如何为我的 hook_form_alter 添加权重?

I have a hook_form_alter in my module, but another module, workbench_access, also has a hook_form_alter which I need to be called before my hook_form_alter. How do I add weight to my hook_form_alter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔一刀 2024-12-20 12:23:25

您只需将 system 表中模块的 weight 列设置为高于 Workbench Access 模块的值即可。

请参阅如何更新模块的权重了解执行此操作的不同方法。一旦完成,清除 Drupal 的缓存,您的模块的钩子将在 Workbench Access 模块(很可能还有许多其他模块)的钩子之后被调用。

You just need to set the weight column for your module in the system table to higher than that of the Workbench Access module.

See How to update a module's weight for the different ways to do this. Once you have, clear Drupal's caches and your module's hooks will be called after those of Workbench Access modules (and most likely a lot of other modules).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文