The Admin Bar Publish Toggle function adds a convenient Publish/Mark as Pending button directly to the WordPress admin bar. This allows quick status changes for posts without navigating to the edit screen.
Overview
When viewing a post on the frontend or in the admin edit screen, this function adds a prominent button to the admin bar that allows you to instantly toggle the post status between “Published” and “Pending Review”.
Key Features
One-click publish/unpublish from the admin bar
Works on both frontend and admin edit screens
AJAX-powered instant updates (no page reload required)
Visual feedback with color-coded buttons
Configurable per post type
Setup Instructions
Step 1: Enable the Function
Navigate to Voxel Toolkit > Functions in your WordPress admin
Find Admin Bar Publish Toggle in the list
Toggle the switch to enable the function
Click Save Changes
Step 2: Select Post Types
Choose which post types should display the publish toggle button:
In the Post Types section, check the boxes for the post types you want to enable
Common options include: posts, pages, and Voxel custom post types (places, events, jobs, etc.)
Click Save Changes
How It Works
Button States
Current Status
Button Text
Button Color
Action
Pending
Publish
Green
Changes status to Published
Published
Mark as Pending
Yellow/Orange
Changes status to Pending
Where the Button Appears
Frontend: On any single post page for enabled post types
Admin: On the post edit screen (post.php)
Note: The button only appears for posts with “pending” or “publish” status. Draft, trashed, or other status posts will not show the toggle button.
Use Cases
Content Moderation
Quickly review and approve pending content while browsing the frontend of your site.
Temporary Unpublishing
Need to temporarily hide a listing? One click sets it to pending while you make updates.
Listing Management
For directory sites, easily approve or unpublish listings without navigating through multiple admin screens.
Troubleshooting
Button Not Appearing
Ensure the function is enabled in Voxel Toolkit > Functions
Verify the post type is selected in the configuration
Check that the post status is either “publish” or “pending”
Make sure you have permission to edit the post
Confirm the admin bar is visible (not hidden by theme or other plugins)
Status Not Changing
Check browser console for JavaScript errors
Verify you have edit permissions for the post
Ensure no caching is interfering with AJAX requests