Congratulations, Mrs. SPLOT, It’s a Plugin

After a longer than expected delivery period, the baby is breathing. Now it’s time for some folks to give it a tickle.

There are two sites now running the very first versions of the TRU Writer SPLOT running completely as a WordPress plugin. This means rather than the functionality being coded into a child theme (and all sites looking like children of the Radcliffe parent theme it was built on), with this plugin you ought to be able use it in any other theme.

Series of the same site in different themes.
A Writer SPLOT can now wear any theme.

There are two places you can give this a try – the first is at coventry.domains as this was a request from the Disruptive Media Learning Lab (who have also supported the development of this plugin). Try the SPLOT Writer there sporting the Hitchcock theme (what it’s wearing at the moment). And also see it on my own domain where the SPLOT Writer is sporting the Miyazaki theme.

Please try doing some media embeds in your test writings- some early testers are seeing them not saved– and put lots of formatting in.

This move was made first by pulling out all of the code from the theme templates into a test child theme (all of the code is in function template files). All of the functionality of the form that accepts and publishes the content was rolled into one shortcode, so making a page into the one who want the form to appear means adding [writerform] to the page (this is created for you when activating the theme).

A lot more work was needed to pull out form template files the way the published content shows up- mainly through filtering the_content to add the meta data at the bottom of a published item– see what is listed at the bottom of a published item under “Writing Details” (the name of this heading is something you can modify in the Customizer).

Even more work was needed to work out some rewrite rules to manage the links for generating a random page as well as the special link for sending a request for an edit link.

It has exactly the same settings screens as the original and the Customizer features to modify the form labels and instructions.

In theory, one could take an existing TRU Writer site, change the theme, activate the new plugin and make it go (oh, it’s likely you would have to re-enter the options– one day I might make these something that can be imported / exported).

I’ve done only rather simple plugins to this point. I naively thought at first it would be a matter of stringing together the series of files that make up more or less the equivalent of functions.php in a theme.

But I wanted to be a bit more proper, so I used the WordPress Plugin Boilerplate Generator. This means the code is also written in PHP OOP format, and my knowledge of classes et al was pretty thin. At this point I wonder if I did it “right” as the code for the public object is over 2000 lines. There were some tricks to bring in the code I have used for the Writer Options, which is itself a separate object.

The first version then is showing it’s duct tape. I have an early version of the plugin just freshly toasted to GitHub.

I definitely welcome testers, but know that this is not quite yet prime time, and you may end up needing to update it many times (this might be a good case to use the WP Pusher plugin, which can update yours directly from github).

Send any bugs or questions to the repo man (or repo, man) https://github.com/cogdog/splotwriter/issues

The other thing is I can have no idea how it will play with other themes. It’s going to be best for themes that publish posts as featured images to the front page. The layouts of the forms will depend heavily on the theme design. I may start a wiki are on the code repo to share info ontrying with different themes as well as suggested CSS to add to the Customizer.

And this allows some funky things- like using the Writer capability inside the theme used as the parent of TRU Collector. This is a SPLOT “Inception”?

The SPLOT Writer displayed inside a theme used for another SPLOT.
The features of the TRU Writer SPLOT can be placed into the same theme used for the TRU Collector.

Or to go even more wild, see how the new plugin plays inside the same theme used by the original version. This is SPLOT Recursion.

With the new plugin, why not try it in the same theme (Radcliffe) that powers the original TRU Writer. BECAUSE I CAN!

There are some small things you don’t get in the plugin, like the labels on the “next” / “previous” navigation, some of the post meta formatting. But hey, that could be fixed in a child theme…

Please give this a try, and let me know how this might help out your own projects. If you want to see maybe another plugin made, consider supporting this work. I could do more if there were not other bill paying projects to juggle.


Featured Image: Added the SPLOT logo to a Second Life era image what’s plugged in is smoking flickr photo by ??? TORLEY ??? shared under a Creative Commons (BY-SA) license

Privacy Statement