Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress init/plugins\u加载的钩子被多次激发_Php_Wordpress_Macos - Fatal编程技术网

Php Wordpress init/plugins\u加载的钩子被多次激发

Php Wordpress init/plugins\u加载的钩子被多次激发,php,wordpress,macos,Php,Wordpress,Macos,新安装的Wordpress 5.5.1,默认主题为2020。 添加非常短的插件(插件中没有其他代码): 我在debug.log中看到的内容: [18-Oct-2020 16:20:01 UTC] plugins_loaded fired! [18-Oct-2020 16:20:01 UTC] here do something after plugins_loaded... [18-Oct-2020 16:20:03 UTC] plugins_loaded fired! [18-Oct-2020

新安装的Wordpress 5.5.1,默认主题为2020。 添加非常短的插件(插件中没有其他代码):

我在debug.log中看到的内容:

[18-Oct-2020 16:20:01 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:01 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:03 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:03 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:04 UTC] init fired!
[18-Oct-2020 16:20:04 UTC] here do something after init...
[18-Oct-2020 16:20:07 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:07 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:07 UTC] init fired!
[18-Oct-2020 16:20:07 UTC] here do something after init...
[18-Oct-2020 16:20:09 UTC] init fired!
[18-Oct-2020 16:20:09 UTC] here do something after init...
什么??
请记住-没有其他代码,除了2020主题之外没有其他页面,只有一个插件被激活(这一个)。所以,我不能强迫这种不正常的行为。

init被解雇了
在10秒内被触发3次,这并不多,你是在本地工作还是在服务器上工作?@Marcelloperi:这些钩子应该在doc中写入时触发一次。此日志是在本地主机上收集的,但对于服务器,它看起来是相同的。使用fired one表示什么?你希望在日志中看到什么?@marcelloperi:我希望看到init只有一个日志记录,插件也有相同的记录_loaded@MarcelloPerri:为了正确初始化我的插件,我需要在Wordpress会话生命周期中使用一次激发的钩子。它可能是什么钩子?
init被触发了
在10秒内被触发3次,这并不多,你是在本地工作还是在服务器上工作?@Marcelloperi:这些钩子应该在doc中写入时触发一次。此日志是在本地主机上收集的,但对于服务器,它看起来是相同的。使用fired one表示什么?你希望在日志中看到什么?@marcelloperi:我希望看到init只有一个日志记录,插件也有相同的记录_loaded@MarcelloPerri:为了正确初始化我的插件,我需要在Wordpress会话生命周期中使用一次激发的钩子。可能是什么钩子?
[18-Oct-2020 16:20:01 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:01 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:03 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:03 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:04 UTC] init fired!
[18-Oct-2020 16:20:04 UTC] here do something after init...
[18-Oct-2020 16:20:07 UTC] plugins_loaded fired!
[18-Oct-2020 16:20:07 UTC] here do something after plugins_loaded...
[18-Oct-2020 16:20:07 UTC] init fired!
[18-Oct-2020 16:20:07 UTC] here do something after init...
[18-Oct-2020 16:20:09 UTC] init fired!
[18-Oct-2020 16:20:09 UTC] here do something after init...