h5p / h5p-wordpress-plugin

Adds support for H5P Content in WordPress.
https://wordpress.org/plugins/h5p/
71 stars 74 forks source link

New print_h5p_content filter #122

Closed arzola closed 3 years ago

arzola commented 3 years ago

I added a custom filter print_h5p_content to be able to hook the h5p HTML content wrapper creation, this could be useful to modify the wrapper of each h5p activity.

Problem

There is no a way to modify the HTML output for each h5p activity

Solution

We need to create a specific anchor link to each h5p activity, currently the h5p-iframe-wrapper uses h5p-iframe-' . $content['id'] to identify each activity however we need a unique identifier so it could be solved adding an extra wrapper.

We think this could be useful for other developers to modify the HTML output in a clean way.

Example

add_filter('print_h5p_content', function($content) {
    return '<div class="customWrapper">'.$content.'</div>';
});

We think this could be a good addition to the plugin :) Thank you

SteelWagstaff commented 3 years ago

Hi @icc, @thomasmars and @falcon-git, @arzola is a colleague of mine at Pressbooks. It's been a while since we talked last, but hope all is well with you and the rest of the Joubel team. Let us know if we can do anything to help you review this PR in a timely manner?