Hey @Jrjmkey,
This has got me thinking about how customizable HivePress could really be. Anyway, I asked my AI for their approach. Iâve not tested this, but it might offer you some valuable insights and help guide you in the right direction.
Do keep us updated with your findings!
AI:
Short answer: HivePress doesnât provide a Gutenberg-based front-end submission screen, so the practical way to give end-users the full block editor is to route them into a locked-down wp-admin screen for the hp_listing post type, make sure that post type is Gutenberg-enabled, and replace the normal âAdd Listingâ flow with a redirect to post-new.php?post_type=hp_listing. You keep all HivePress logic (attributes, pricing, booking, etc.) while giving users the real block editor.
Below is a drop-in mini-plugin that does exactly that:
Ensures hp_listing supports Gutenberg (show_in_rest + editor support).
Forces the block editor for hp_listing.
Replaces the HivePress âSubmit Listingâ page with a safe redirect to the Gutenberg editor.
Locks down wp-admin for vendors so they only see Listings and Media (optional, tweak as you like).
Grants the vendor role the capabilities needed to create/edit listings and upload media.
Save as wp-content/plugins/hp-gutenberg-submit/hp-gutenberg-submit.php and activate.
<?php
/**
* Plugin Name: HP Gutenberg Submit (Frontend â Gutenberg)
* Description: Replace HivePress submit page with Gutenberg editor for end users, while keeping admin locked down.
* Version: 1.0.0
* Author: You
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* 1) Make sure the HivePress listing post type is Gutenberg-ready.
* We do this without re-registering the CPT by filtering args.
*/
add_filter( 'register_post_type_args', function( $args, $post_type ) {
if ( 'hp_listing' !== $post_type ) {
return $args;
}
// Enable REST (required for block editor) and ensure editor support is present.
$args['show_in_rest'] = true;
$supports = isset( $args['supports'] ) ? (array) $args['supports'] : [];
$supports = array_unique( array_merge( $supports, [ 'title', 'editor', 'thumbnail', 'excerpt' ] ) );
$args['supports'] = $supports;
return $args;
}, 10, 2 );
/**
* 2) Force the block editor for hp_listing.
*/
add_filter( 'use_block_editor_for_post_type', function( $use_block_editor, $post_type ) {
if ( 'hp_listing' === $post_type ) {
return true;
}
return $use_block_editor;
}, 10, 2 );
/**
* 3) Replace the HivePress "Submit Listing" flow with a redirect to Gutenberg.
* If you still want the multi-step form for metadata, keep that page; otherwise this sends users straight to post-new.
*
* This hook runs when HivePress renders the submit page; we intercept and redirect.
*/
add_filter( 'hivepress/v1/templates/listing_submit_page', function( $template ) {
// Only redirect logged-in users who can create listings.
if ( is_user_logged_in() && current_user_can( 'edit_hp_listings' ) ) {
wp_safe_redirect( admin_url( 'post-new.php?post_type=hp_listing' ) );
exit;
}
return $template;
}, 0 );
/**
* 4) Optional: redirect the "Edit listing" front-end endpoint into wp-admin post edit as well.
* This makes the entire listing workflow live in Gutenberg.
*/
add_action( 'template_redirect', function() {
if ( ! is_user_logged_in() ) { return; }
// If you're using a dedicated "edit listing" endpoint (e.g., /account/listings/edit/123),
// you can parse the query and redirect. HivePress sets 'listing_edit_page' internally,
// but a safe generic approach is to watch for ?hp_listing_id=<id> on your custom link.
if ( isset( $_GET['hp_listing_id'] ) ) {
$post_id = absint( $_GET['hp_listing_id'] );
if ( $post_id && get_post_type( $post_id ) === 'hp_listing' && current_user_can( 'edit_post', $post_id ) ) {
wp_safe_redirect( admin_url( 'post.php?post=' . $post_id . '&action=edit' ) );
exit;
}
}
});
/**
* 5) Give the vendor role the caps they need (on activation).
* Adjust role slug if your vendor role name differs.
*/
register_activation_hook( __FILE__, function() {
$role = get_role( 'vendor' ); // HivePress usually creates a 'vendor' role.
if ( ! $role ) { return; }
$caps = [
'read',
'upload_files',
'edit_posts',
'edit_hp_listings',
'edit_published_hp_listings',
'publish_hp_listings',
'delete_hp_listings',
'delete_published_hp_listings',
];
foreach ( $caps as $cap ) {
if ( ! $role->has_cap( $cap ) ) {
$role->add_cap( $cap );
}
}
});
/**
* 6) Lock down wp-admin for vendors so it feels like a âfront-endâ editor.
* Hide everything except Listings and Media. Tweak as needed.
*/
add_action( 'admin_menu', function() {
if ( ! current_user_can( 'vendor' ) ) { return; } // cheap check; refine if needed
// Remove menus vendors don't need.
remove_menu_page( 'index.php' ); // Dashboard
remove_menu_page( 'edit.php' ); // Posts
remove_menu_page( 'edit.php?post_type=page' ); // Pages
remove_menu_page( 'edit-comments.php' ); // Comments
remove_menu_page( 'themes.php' ); // Appearance
remove_menu_page( 'plugins.php' ); // Plugins
remove_menu_page( 'users.php' ); // Users
remove_menu_page( 'tools.php' ); // Tools
remove_menu_page( 'options-general.php' ); // Settings
remove_menu_page( 'woocommerce' ); // WooCommerce (if present)
remove_menu_page( 'edit.php?post_type=product' ); // Products (if present)
// Keep: Media and hp_listing (registered by HivePress)
}, 99 );
/**
* Optional: keep vendors out of the main wp-admin dashboard and land them directly on "Add Listing".
*/
add_action( 'admin_init', function() {
if ( ! is_user_logged_in() || ! current_user_can( 'vendor' ) ) { return; }
$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
// If they hit the Dashboard or disallowed screens, push them to Add Listing.
if ( isset( $_GET['page'] ) || ! $screen ) {
return;
}
$allowed_screens = [
'upload', // Media Library
'media', // Media edit
'edit-hp_listing', // All Listings
'hp_listing', // Listing edit
];
if ( ! in_array( $screen->id, $allowed_screens, true ) ) {
wp_safe_redirect( admin_url( 'post-new.php?post_type=hp_listing' ) );
exit;
}
});
/**
* 7) Nice-to-have: change the âAdd Listingâ button/link anywhere on site to point to Gutenberg.
* If you output a custom âAdd Listingâ link, use this helper.
*/
function hp_gutenberg_add_listing_url() {
return admin_url( 'post-new.php?post_type=hp_listing' );
}
How this works (and why itâs the least painful path)
The block editor only runs within wp-admin for a given post type. Thereâs no supported, stable âfrontend Gutenbergâ UI you can drop into a HivePress template. Embedding the editor in a public page is possible but brittle and a huge build.
HivePress already stores the long description in the post content, so the Gutenberg editor maps perfectly to that field. All the structured pieces (attributes, location, price, booking) still live in HivePress meta and its booking extensions. On the wp-admin edit screen, those appear as meta boxes beneath/alongside Gutenberg.
By redirecting the submit page you keep the user journey simple: âAdd Listingâ â block editor â Publish. You can still keep the front-end list/edit table if you want, and just jump into the editor when creating or editing.
If your vendor role slug isnât vendor, change it in the plugin.
If you need to keep HivePressâs front-end steps for some attributes, you can do a hybrid flow: use Gutenberg for the main content and featured image, and keep a minimal front-end step for any must-have structured fields. In that case, remove (or conditionally bypass) the submit-page redirect block.
If attributes arenât showing as meta boxes in Gutenberg, make sure HivePress is adding them on the edit screen in your build. Most do; if not, you can register your own meta boxes that read/write the same meta keys HivePress uses.
For a super clean feel, pair this with an admin-theming plugin or a small CSS file to declutter wp-admin for vendors.
I hope this helps!
Cheers,
Chris 