admin管理员组文章数量:1130349
I am trying to create a plugin which captures the hooks for subscription and transaction changes.
I managed already to add the correct hooks as actions. I am receiving the transaction object and am able to get the according user. When the status of a transaction changes eg. from pending to complete the method $user->is_active() shows that the user is no longer active, which is right.
If i delete a transaction this method returns true which is wrong. When i am switching to the users afterwards the user is no longer active in the list (in dashboard).
It seems like the updates to the user are done after the hook fires.
Is there any way that i can delay the action call to the hook?
I know WordPress offers priorities for hooks but that didn’t work. I somehow need to manage to create something like a Future object. But we are talking about PHP and i don’t want to include an async library like Amp. It seems overkill to me.
Thank you :)
I am trying to create a plugin which captures the hooks for subscription and transaction changes.
I managed already to add the correct hooks as actions. I am receiving the transaction object and am able to get the according user. When the status of a transaction changes eg. from pending to complete the method $user->is_active() shows that the user is no longer active, which is right.
If i delete a transaction this method returns true which is wrong. When i am switching to the users afterwards the user is no longer active in the list (in dashboard).
It seems like the updates to the user are done after the hook fires.
Is there any way that i can delay the action call to the hook?
I know WordPress offers priorities for hooks but that didn’t work. I somehow need to manage to create something like a Future object. But we are talking about PHP and i don’t want to include an async library like Amp. It seems overkill to me.
Thank you :)
本文标签: plugin developmentMemberpress Hooks and Activity
版权声明:本文标题:plugin development - Memberpress Hooks and Activity 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749040688a2307088.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论