Expose editor in wordpress non-admin

Hi,

 

We are building a web application based in wordpress where users can create h5p content and share with others. The current wordpress plugin allows to create h5p content only through the wordpress backoffice and so far we have been exposing the h5p editor to certain users by giving them certain permissions and using an iframe to popup the h5p section of the admin section so they can create their content without major configuration.

 

This is not a desirable setup of course because may expose security vulnerabilities and we are using it as an experimental setup. Since I have been reading a lot and I haven't found any evident solution I'd like to ask you for suggestions:

 

 What would be the proper way of embedding the editor in the front end of wordpress?

 

I appreciate your help in advance. Thank you and keep doing this amazing work!

 

Kind Regards,

 

Robert

papi Jo's picture

Moodle has a very elaborate "roles/permissions" feature which would enable you to do just that. You do not say if your WP involves "teachers" and "students". If that is the case, then Moodle is a far better CMS than WP (but more complex, of course).

Thank you very much for your comment. However, let me point out that I'm not asking which platform is better but how to do this in wordpress since our entire platform is build on top of that. If you have further comments I will be glad to hear about!

icc's picture

Hi Robert!

I've seen this request a couple of time previously – so, you're not alone. To be able to achieve what you want you'd have to move certain portions of the code under plugins/h5p/admin into the plugins/h5p/public area instead. This can quickly get complex and take a couple of working days to get it working right. I can't see any easy quick fixes that will help you achieve what you want without compromising security.

I have noted down your request, so if we are doing any larger changes we'll keep in mind to have the generic components outside of the admin/dashboard area.

You are of course very welcome to start this work if you'd like to and we'll happily accept any pull request for this. I'd start by looking at the display_new_content_page() function inside the admin/class-h5p-content-admin.php file which basically creates the form you use to create content.

Let me know if you have further questions, I'd be happy to answer them.

Hi icc!

 

Thank you for your comment, very helpful, I had already decided to hack the display_new_content_page() function inside the admin/class-h5p-content-admin.php so now I know I'm in the right track. I see many things inside that class are highly entangled with another things, thus by now I decided to build a small plugin which uses the h5p classes (so it depends on yours) and have also included a mangled version of the views/new-content.php file. This means that I have also to include the form post logic in this new plugin but I think is the most appropiate thing to do as well.

 

Anyway I'll try to do it as generic as possible so in case I succeed I'll post my solutions so others can use it or learn from it.

 

Thank you once more and keep doing this amazing work!

 

Robert

icc's picture

That sounds like a good way of doing it. Thanks for sharing.

Hi Robert,

Just quickly touching base to find out if you were successful in implimenting the creation of content on the front end?

Can you Kindly advise. I'm looking into a solution myself.

Kendell

Did you manage to do it ? I would like to do the same. Thanks ;)

Hi @theogdt,

I've integrated this plugin to get the trick done: wpfrontendadmin.com

Have a look and let me know how it goes for you.

 

Regards,

Kendell