I am trying to get some sites to remain in Unpublished status until certain conditions are met.
However, I have a problem with the message ProcessPageEdit: Published Page.
Overall, wire()->addHookAfter("Pages :: saved") seems to work for existing pages. And I can put them into Unpublished status whenever I want after I have saved them.
But when creating a new page, the order of events is different. The newly created page is set to Published status when someone clicks Publish in the second step of the page adding process. But it runs after my code.
How to solve this problem?
Is there any documentation about the order of events?