• Resolved Cirkut

    (@cirkut)


    I’m curious why H5P isn’t implemented using a custom post type or using the standard post object and instead opts to do things more manually.

    We’re trying to set up a repository where users can create their own H5P modules, and we display all the modules as a kind of archive (like a blog listing of modules), and also be able to show each user all their own H5P modules.

    In order to achieve this and tagging some of the modules with more information, we’re wanting to use Advanced Custom Fields (one of the most popular plugins written for WordPress), but there’s no way to use ACF to add custom fields.

    There also doesn’t look like there’s a way to simply query (using the standard post loop) H5P ‘posts’.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author icc0rz

    (@icc0rz)

    Could you be more specific as to which standard practices you are referring?

    Note that the plugin was developed some time back and that the developers did follow the example of similar plugins(e.g. quiz plugins). APIs may have changed since then.

    I do agree it would be really nice to get features such as the tagging, categories etc. for free from WP but we did not find any easy way of reusing it when implementing. Maybe you could point us in the right direction for future use and improvements?

    Thread Starter Cirkut

    (@cirkut)

    For example, we were looking at creating a front end view of all H5P objects created, along with a description and some other characteristics of the object including author and some custom fields.

    The problem is that H5P doesn’t create its objects as an individual post inside WordPress. This has always been the standard in WordPress, where typically each H5P would have a post title, post description, post author, the content (which would be replaced with the actual H5P builder), and the ability to categorize and add meta to each post. Since H5P creates its own implementation of saving and storing an H5P object, it’s not targetable by a WP_Query, and it can’t be added to by something like Advanced Custom Fields (we were wanting to add things like whether an object is meant for accessibility, or what type of education/industry the object is meant for, etc.).

    But because H5P isn’t built out to use a custom post type, it can’t implement custom fields other than actually modifying the H5P plugin.

    This is where to start with custom post types.

    Plugin Author icc0rz

    (@icc0rz)

    This has always been the standard in WordPress

    Well, no. The standard practices you speak of was introduced in 3.0 it seems, which was released in mid 2010.

    The H5P plugin was designed and created at the beginning of 2014, and simply followed the standard practices of other similar plugins back then. I assure you we did not take any extra measures to try and circumvent standard practices. I am sure the benefits and need for having decoupled objects back then outweighed the effort of creating a custom post type.
    I don’t think that I can give a better answer to your question than that.

    Would it have been useful and cool to see H5P as a custom content type today? Yes.
    Luckily this is open-source and hopefully, we’ll see someone give it a shot soon.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Why circumvent standard practices?’ is closed to new replies.