I mentioned this in Slack a few days ago, just posting it here so it doesn’t get lost.
The publish_form_channel_preferences hook doesn’t seem to be a thing in EE3 anymore. As far as I can tell its the only hook that could be called on the publish/create or publish/edit page aside from sessions_end in EE2 aside from whatever hooks are called for fieldtypes. In EE3 right now, from what I can tell, its difficult to do something just on the publish/create and publish/edit pages and no where else. publish/edit has the publish_form_entry_data hook to work with, but no such thing exists for publish/create.
Using session_end isn’t viable because ee()->session isn’t set for some reason so other services that may need to be called on the publish/create and publish/edit pages that rely on session data can’t be used.
In EE2 the publish_form_entry_data hook is called when creating and editing an entry. In EE3 its only called when editing.
The publish_form_channel_preferences hook used to be another way to do specific things on create and edit pages without doing hacking things in sessions_end, but since its not a thing anymore we’re left with no viable option to do non-fieldtype related things on the publish pages.
I was using these hooks to add a toolbar to the publish page for Publisher. I can add the toolbar html to the page with cp_js_end (kind of a janky way to do it, but it works), but there is a whole slew of other things I need to do, e.g. check the user’s permissions, check the entry data when editing to see what the toolbar should be doing, which I can’t do with cp_js_end. publish_form_channel_preferences was a good place to do this in EE2 b/c it was called on the create and edit entry pages, but its not called at all in EE3. I used publish_form_channel_preferences kind of like a session_end hook just for the publish/create and publish/edit pages.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.