GG资源网

如何在WordPress插件之前定义常量

问题描述:

I have the plugin which have constant defined, i will call this plugin PLUGIN A:

I want to make another plugin PLUGIN B which will define constant BLA before PLUGIN A. Is that possible? I guess WordPress needs to read PLUGIN B before PLUGIN A, but in which order WordPress is reading plugins?

图片转代码服务由CSDN问答提供

感谢您的意见,我们尽快改进~
功能建议

我有一个常量定义的插件,我将调用此插件PLUGIN A:</ p>
\\ n

  if(!defined(\'BLA\')){
define(\'BLA\',\'http://google.com);
}
</ code> </ pre>

我想制作另一个插件PLUGIN B,它将在PLUGIN A之前定义常量BLA。这可能吗? 我想Wordpress需要在PLUGIN A之前读取PLUGIN B,但Wordpress正在以哪种顺序读取插件?</ p>
</ div>

网友观点:

WordPress loads plugins in a specific order. I found this question/answer here on Stackoverflow: https://wordpress.stackexchange.com/questions/63141/in-what-order-does-wordpress-load-plugin-files

So, the order is:

  1. Must-use plugins (plugins in the optional mu-plugins folder)
  2. If you\'re running a multisite installation, it checks for plugins that are network-activated and loads those.
  3. Then it checks for all other active plugins by looking at the active_plugins entry of the wp_options database table, and loops through those. The plugins will be listed alphabetically.

Hope this helps!

由于网站搬家,部分链接失效,如无法下载,请联系站长!谢谢支持!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 如何在WordPress插件之前定义常量

发表回复

CAPTCHAis initialing...
© 2021-GG资源网 - www.ggplus.cn. All rights reserved