Programmers (can I call myself one?) have a tendency to be lazy. And laziness can result in a tool that may save a few seconds here and there, but by golly, those seconds matter!
I work on a lot of client sites, and the themes are rather inconsistent with adding “edit” links for posts or pages. Add in the fact that some of the sites have disabled the toolbar, I got rather frustrated disabling the code and/or manually searching for the item in the WordPress admin area.
Introducing Slash Edit
I thought to myself, wouldn’t it be cool if I could just add a “/edit” (slash edit, get it?) to a post or page and be redirected to the post editor for the item?
I then thought to myself, “Surely there is some brilliant genius who already thought of this and coded a solution.”
I went to the almighty Google and searched. I went to the WordPress plugin repository, and searched. Nada. The best I could find was some random Stack Overflow snippets that hinted at adding an edit link.
Not finding a solution, I started researching the dreaded Rewrite API and saw hope. A nifty little function called add_rewrite_endpoint could pretty much get me mostly there. All I had to do was set up an endpoint (i.e., /edit) and write a redirect function.
I coded it up in maybe an hour, threw it on GitHub, and announced it to the world.
— Ronald Huereca (@ronalfy) October 19, 2014
The Reaction Was Phenomenal
For such a small plugin, the initial reaction floored me.
— Yeah, it's a no from me, Doug. (@zamoose) October 19, 2014
— Ryan Hellyer (@ryanhellyer) October 19, 2014
— кг|sтоf вегиаегт (@ssstofff) October 19, 2014
So What Are the Use-Cases?
I’m going to use it as I originally intended to. When I’m working on a client site, whether on production or locally, I’m going to install the plugin. Inevitably I’ll run into the situation where I’m browsing a post or page and I spot a typo of some sort. Because I’m naturally an idiot, I haven’t logged in, so now I have to open a new tab, log in, and refresh the post or page so I can see the WordPress toolbar.
And if the toolbar is there, I click on the “Edit Post” or “Edit Page” button and am taken to the correct item in the WordPress admin area.
Or, with the plugin installed, I can add a “/edit” to the end of the post or page URL and be auto-magically redirected to the correct item. If I’m not logged in, WordPress prompts me, and then I’m redirected appropriately.
My friend Ryan Hellyer summarizes his own use-case:
This is an excellent little tool. I hate having to work out what page I’m on just to edit something.
So, What’s Next?
The plugin, for now, is feature complete. I imagine there will be feature requests, and I’ll attend to those on an as-needed basis. If it makes sense to add the feature in, I’ll do it.
However, I’m a big fan of the Decisions, Not Options philosophy, so I’ll only add the feature in as long as it makes absolute sense.
And as with my previous released plugin, Simple Comment Editing, I vow not to have any visible options in order to make this thing as plug-n-play as possible.
Get the Plugin
As a special offer to you, the first infinite number of customers get the plugin for free!
How Can I Help?
This is a brand new plugin, so if you’re into WordPress at all, tweet about it, share on Facebook, write a review on WordPress.org or on your own site, or just plain install it and use it.
Slash Edit is a tool born out of pure laziness, but if it shaves a few seconds off of your workflow, I think the plugin is very worth downloading/installing.