ewinter
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Forms for ACF] Init hook priority issueHi!
Thanks for your reply and sorry for my fault – I was completely certain, that the default is 15 ??
PODS and all other named plugins are mostly using the default priority. Because wordpress loads plugins in alphabetical order yours is loaded first and therefore your hooks are registered before others with the same priority.
In my usecase I want to create a post of a custom post type using the submitted form data, therefore PODS have to be loaded before Advanced Forms. I don’t know if you want your custom post types form and entry to get extended by user. In this case the current load order is fine.
But I think both should be possible. The main problem is, that you are using the ‘init’ hook to process submitted forms. What do you think about using ‘wp_loaded’ to call pre_form function? Another option would be to submit your forms using ajax and making use of the default ajax actions. But I think this is too much work for a small problem.Best regards,
EricForum: Plugins
In reply to: [Advanced Forms for ACF] Init hook priority issueUpdate: Changing the priority only in core-forms introduces errors with form emails. Therefor all other wordpress related hooks must be changed to the same value too.
I now investigated other plugins that may be used together with Advanced Forms like: PODS, CPTUI, other ACF-Extensions, Shortcode related plugins like WPBakery Pagebuilder + Addons, and email related plugins like WPSMTP and I would propose changing the hook priority to 14 for all directly worpress core related hooks like ‘init’, ‘admin_init’, ‘edit_form_after_title’, ‘save_post’, ‘media_buttons’, ‘admin_notices’, …
This would allow other plugins to run its hooks before Advanced Forms and user hooks (priority >= 15) after.Would you please include this change or at least
a) a workarround like user changable priorities or
b) a function or hook to get the reference to you class instances allowing to unset and reregister your hooks.Greets, Eric