Manga+Press 4.0 Changes

It’s not released yet. Probably not until the end of September at this rate. Anyway, I wanted to add some information because like 3.0, Manga+Press 4.0 has breaking changes, this time surrounding the Latest Comic and Comic Archive page functionality.

The goal behind these changes was to bring these two pages back inline with how WordPress handles archive templates. The vast majority of issue reports I’ve had has had to do with these two pages, so the main goal for this release was to fix them.

There is an alpha version for download if you want to take it for a spin. DO NOT—I repeat—DO NOT use this version in a production environment because it will break things.

Comic Archive page

This is actually easier to deal with than the Latest Comic page was, because the fix was simple: enable the has_archive option on the Comic post-type, and give it a custom slug. Which should have been done way back when I updated Manga+Press to use custom post-types. So now, the Comic Archive page follows the WordPress template hierarchy. Which means, that there’s no custom work going on in the backend to create the comic listing, other than the switches to change the templates, and grabbing all comics instead of a per-page amount. However, I may change “unlimited” to “per-page” with an option to override, because I can see “unlimited” causing potential performance issues if an end-user has a lot of comics.

Latest Comic page

After some consideration, I realized that this page didn’t fit into the standard WordPress template hierarchy, so something different had to be done. I decided (for now) on creating a custom end-point with its own template. With the custom end-point, there’s a base $wp_query object that can be overridden by using the pre_get_posts action. So I’m overriding that query to add the most recent comic.

I’m still thinking about creating a new custom post-type to handle Latest Comic page, which have the added advantage of having its own archive, which means that in theory, a comic author can run separate series.

Either way, the Latest Comic page functionality is still up in the air right now. What ever I decide on, I want to maintain some form of backwards compatibility.

Other changes

After taking inspiration from WooCommerce, I’ve added new actions to allow other theme developers to better integrate Manga+Press templates. I’m also using another WooCommerce concept: theme compatibility. Basically, it eliminates the need for a child-theme if you’re using one of the standard WordPress themes, and I’m also providing a hook for other developers to add their own compatibility markup. What this means that I’m going to sunset the original child-themes, and keep compatibility going back to the TwentyFourteen theme.

Finally, with this next release, I’m no longer supporting versions of PHP older than 7.0, since WordPress itself now supports PHP 7.2. If your host doesn’t have the minimum requirements as recommended by WordPress, and if they won’t update their server to meet those requirements, then it’s very likely time to move on.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.