我正在使用transition_post_status
处理正在发布的帖子。我在WordPress的两个安装之间发现了不一致的行为,我已经跟踪到了从post compose页面本身发出的AJAX调用。
以下是我在两次安装中将帖子从草稿转换为发布时提出的请求:


如您所见,对post的AJAX调用。在第二个示例中,没有生成php。事实证明$post
对象在内部处于不同的状态transition_post_status
通过post呼叫时挂断。php,这就是为什么我的代码只在第一次安装时起作用。
我需要理解的是,为什么我有两个WordPress安装,它们在发布帖子时似乎在做不同的事情。
这两个安装都运行5.7.2,除了我正在使用的1个插件之外,还有库存,这两个安装都是一样的。
有人能解释为什么在发布帖子时,两个不同的安装会触发不同的AJAX调用吗?