Open HaidarZ opened 4 years ago
Although hacky and messy I needed to get this to work and did it like this:
public/class-h5p-event.php
into that plugin.spl_autoload_register
or make it a mu-plugin.H5P_Event
and add do_action()
calls for the intended event. Something like if($type === 'content'){ do_action('my_h5p_hooks_plugin . '_' . $sub_type); }
I have intentionally only added instructions here and no final code since this is hacky and you need to fully understand what you are doing here including being aware that you'll need to repeat this on every H5P update to handle the case of H5P_Event
being changed upstream.
If you do not understand what you are doing here and/or forget to keep this in sync with H5P updates this will probably end in a fatal error taking down your entire site at some point.
You have been warned. :wink:
Hello guys,
Is it possible to add hooks for h5p content create/update/delete , just like what you've done with h5p_mods.
In that way we can easily integrate the h5p content within wordpress. For example we can create a custom post upon content creation that includes the h5p_content shortcode in it's body.
All of this process is now done manually and not easy for non-technical content editors.
Psuedo code
Just add the
do_action
hooks after the creation/update/deletion of the content.Regards,