You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Add an autoloader to this plugin that loads this class. Make sure that this autoloader runs before the one from H5P. The easiest way to do this setting prepend to true on spl_autoload_register or make it a mu-plugin.
Edit the Constructor of the copied 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.
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,
The text was updated successfully, but these errors were encountered: