It might seem counter intuitive to remove from the WordPress dashboard the menu items that allow a user to create posts.

Or crazy.

But follow my weaving here. This all started when Dave Cormier picked up my call to try a SPLOT. Well, I actually whinged

Dave wasted little time! But in no time quick was messaging Bad News.

That’s one I’ve not seen before. So I went over to one of my WordPress mutisites, made a new blog, set the theme to Baskerville, installed the plugin, and hey it all just worked.

Now I know the worst thing you can do when try to help someone with a technical issue is say, “it worked for me.” That does nothing (or less) for the recipient. So Dave DM-ed me a login, I checked our his site, made a few settings since I am so familiar with the theme. I made a quick post via the Writer functionality. I still cannot get a white screen of death.

He messaged that it was still happening.

Argh.

Then it became clear. He was not quite familiar with how the SPLOT worked, and he was trying to create something new, the regular way one does in WordPress, by making a new post in the dashboard.

That’s not how it’s done! For the content creation SPLOTs, it’s all done from the front end form. Not the back!

I actually had never even done that in one of my SPLOTs. But here is the value of having someone unfamiliar with your work take it for a spin (and crash in the corner).

But it’s a realistic error.

So I dug into stack exchange searches and found some three simple code chunks to add to the themes.

This first one removes the left side sub menu New Post (or Writing) item from the Posts menu (my code cleverly changes Posts to Writings but they are really just posts under the hood).

Next, I want to remove Writing (aka Post) from the dropdown + New in the admin bar. Again, a short chunk of code.

Now one more. When you go to the main listing of Posts (aka Writings) there is a big Add Writing button next to the header. I could not find a way to remove it in code, so I reach for the CSS hammer, and find the proper selectors to make it disappear. This goes into a new CSS file admin.css I created inside the theme’s include directory.

Now I just need some code that will enqueue the special style sheet when the dashboard is loaded:

And poof! Like that, there is no way to generate the SPLOT content except from the front end, where it gets all the special goodies it needs.

I was quickly able to add this as well to TRU Collector and SPLOTbox.

And now, NO NEW POST FOR YOU! (blog post title inspired by Seinfeld).


Featured Image: Created with imgflip meme generator the rights to which remain rather murky.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

Leave a Reply

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