Voxel Toolkit 1.6.1 is Available!

Admin Bar Publish

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

  1. Navigate to Voxel Toolkit > Functions in your WordPress admin
  2. Find Admin Bar Publish Toggle in the list
  3. Toggle the switch to enable the function
  4. Click Save Changes

Step 2: Select Post Types

Choose which post types should display the publish toggle button:

  1. In the Post Types section, check the boxes for the post types you want to enable
  2. Common options include: posts, pages, and Voxel custom post types (places, events, jobs, etc.)
  3. Click Save Changes

How It Works

Button States

Current StatusButton TextButton ColorAction
PendingPublishGreenChanges status to Published
PublishedMark as PendingYellow/OrangeChanges 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
AI Assistant