Creates a Preview and Publish/Update Button in post creation/post edit, that scrolls down the screen as you scroll. No more scrolling back to the top of the editor to hit preview or publish!
The plugin uses minimal code and only a little CSS. Buttons and the tab use default WordPress admin CSS classes.
- If a post is privately published, the blue button now says “Update” rather that “Publish” to avoid confusion.
- All update-related buttons now match the blue on the main update/publish widget.
- Bug fixes and slight UI improvements.
- The floating tab now appears on custom post types, not just the default pages and posts.
Need Help or Have Ideas?
- Use the thread on the plugin page
- Or reach out to me on Twitter (@FibroJedi) or message me at facebook.com/fibrojedi.
I am slowly working on adding the functions needed to translate this and make it useful to non-English speakers. Please bear with me. I’m currently tagging the strings, which should give no discernable problems. Until I figure out the .po/.pot files anyway.
- As mentioned, this has not been tested with Gutenberg. If you want to do this and let me know what code changes I need to make, I’ll credit you once I implement it.
- In your WordPress Admin, go to “Plugins → Add New` and search for FibroJedi.
- Click/tap Install
- Click/tap Activate
1. Upload the whole plugin folder to your
2. Go to the Plugins page and activate the plugin.
3. Your new tab will appear on the right hand side whenever you edit a post or page.
Where is it intended to be used?
FJ-SPPB is a back office plugin and has not been tested with Gutenberg features. Others are welcome to modify it to suit their needs. But I originally made this for me, and I use Classic Editor, so I guess that’s the primary user base.
What Does It Do?
This tiny plugin’s primary role is to create a tab on the right hand side of page/post editor, containing the key “publishing” actions that usually sit at the top of the editor. As you scroll down the page – or writing your content makes the page longer – FJ-SPPB scrolls with you.
As I made this for myself originally, there are a few other features, most of which can be switched off if you do not want them:
- Word Count at the last save/publish action.
- Close for Now: depending on your window size, this will either be a [X] or a circular (X) symbol. This hides the tab until the next save/publish action.
- Confirmation Dialog: get prompted when pressing [Save Draft], [Update] or [Publish].
How Does It Work?
FJ-SPPB does not run the code to save, update or preview your posts. Instead it simulates a click on the default buttons. Thus, what you would expect those ones to do, FJ-SPPB does. See it as a handy shortcut or scrolling bookmark!
Are there any options?
Yes! Under the Settings menu, look for Sticky Preview Buttons. There you can set:
* [1.0] If you want to exclude some shortcodes from being expanded for the purposes of Word Count, you can do so in the code (for now). I rarely need to update this plugin so it will only rarely reset. Search for $shortcodes_to_remove and add a new line for your shortcode. The next update will include this in options.
* [0.3] Show the Word Count (fixed in 0.6)
* [0.3] Distance tab appears from the top of the editor.
* [0.3] Opacity of the tab when a cursor is not over it.
* [0.3] Whether or not you want a link to the plugin’s settings on the tab itself. This link opens in a new tab/window rather than interrupting your editing. Changes will reflect whenever you either publish or save/update, or if you reload/refresh the editor.
* [0.4] Whether you want to enable the sliding effect (large screens only)
* [0.5] Whether you want to add a prompt when using the tab’s Publish/Update button. Note: The normal buttons function however they would have before you added my plugin. I have not altered their behaviour, only the ones on my tab.
I’m open to suggestions on future features, but it already does what I wanted it to. I didn’t want to overdo the settings. It might be other features would be better done as add-on plugins.
Contributors & Developers
“FibroJedi's Sticky Preview and Publish Buttons” is open source software. The following people have contributed to this plugin.Contributors
Translate “FibroJedi's Sticky Preview and Publish Buttons” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
- The blue action button now reads differently depending on the status of the post: published (and public), private, draft and password-protected. This is just for clarity of labelling – the functionality has not been changed.
- Added a confirmation to the circular X button. This just ensures you don’t close the tab accidentally. (It will return on the next save/publish or reload action if you do!).
- Bug Fix: “Headers already sent” error should no longer be a plague. If you’re getting this, please open a help thread as it may be a plugin clash.
- Support added for other post types. Previously this was done by specifying which ones to allow. This makes the default behaviour that it appears for all custom post type, for example.
- Currently disabled on post formats, where I think it’s an unnecessary process for your system: e.g. link, aside, chat etc. If you’d like to see this as an option, please let me know.
- Tested up to WordPress 6.2
- A note in the plugin file (line 80): You can change the items in the array to include shortcodes you wish to be removed before the Word Count is calculated. For example, tables of contents. I will make this an actual plugin option, hopefully in the next version.
- Tested, tweaked and verified with WordPress 6.1
- Minor Bug Fixes.
- Proper release! Minor bug fixes, text updates and settings page amendments.
- [Bug Fix] Word Count now expands shortcodes, then strips the HTML tags, making its estimate far more accurate.
- [New] Quick link to skip to the main custom fields panel. I will add an option to disable this in due course.
- Sliding Effect put into options, so that, if you have a resolution of >=1200px you can keep it visible rather than have it slide away.
- [Bug Fix]: The (X) link was hiding the button area inside the tab, but not the whole tab. This has now been fixed.
- [Update]: The word counting method has been rewritten and is now much closer to the number given in the editor.
- [NEW] (Screens/Resolution >= 1200px) FJ-SPPB now slides off to the right so it’s not overlapping metaboxes. Hover over it to use buttons and it’ll slide back when you’re not hovering (the cursor, not you). Animation done through CSS so is browser-dependent, but most modern browsers should be fine with this.
Next Version: I will make this an option within FJ-SPPB’s settings.
- [Formatting] Reduced the link to settings to the same font size as the word count. Added space between those two (relevant only when both are enabled in settings.)
- Checked compatibility with WordPress 5.9
- [Bug Fix] Switching the [Settings] link off did not work in some cases. This has been fixed.
- New Options for the Sticky Tab!
** Show/Hide Word Count
** Show/Hide link to Settings
** Set distance from the “top” of the screen from 10% to 80%. Higher than 80% not available in case it gets pushed off the screen.
** You can now set an opacity for the tab, which lets you see other metaboxes behind it. Opacity will always be 100% when your cursor is over it. Users of tablets or other touchscreens where you choose not to use a mouse/trackpad should keep this at its default of 100%;
- [X] link to close the tab until next save/publish action, now appears as a blue circle on the right on resolutions >=1000px to make it more intuitive. <1000px screens will get the lightweight [X] as before.
Note: “top” is calculated from the top of the top meta box, rather than the top of the screen, so that you don’t cover up Screen Options, Help etc in the top bar.
- Added link to SPPB settings in the Plugins list.
- moved the ‘top’ attribute from the external CSS and added it inline.
- [Bug Fix] Activation error in some cases. Apologies, that one’s my bad. All tested and working now.
- Bug Fix: [Save Draft] button now correctly appears in the tab on new pages or posts that have not yet had an actual official draft saved (post_status = “auto-draft”). This has been tested and works as intended.
- Bug Fix: [Preview] no longer attempts to preview a new post that does not yet have a title/assigned permalink. This prevents an error 404. Once the title field is completed, [Preview] continues as normal.
- Added word count estimate. Not because I thought others needed it, but I did.
** It is intended to set this as an optional extra in a future release rather than on by default.
- Confirmation dialog when using the [Update] and [Publish] buttons. This does not affect the functionality of the default buttons at the top of the editor.
- Added [Publish], [Update] and [Save Draft] buttons
- Added the “hide for now” link.
- Initial Version with just the [Preview Changes] button
- Retroactive Patch: Updated function names with fibrojedi_ prefix as opposed to fj_ per guidelines.