How can I automatically reset the “verified” attribute on each listing update?

Hello HivePress team and community,

I’m building a C2C marketplace using the MeetingHive theme and HivePress v1.7.11. I need every listing to require re-approval whenever it’s edited, so I want to automatically clear the “verified” attribute on each front-end update.

Here’s what I’ve already tried:

  1. save_post_hp_listing hook
    • Confirmed it fires on edit (using alert in wp_footer), but neither update_post_meta(…, 'verified', '0') nor taxonomy clears worked.
  2. post_updated hook
    • Fires reliably, but hivepress()->attribute->save(…, []) did not remove the attribute.
  3. hivepress/v1/models/listing/update filter
    • Never fired on listing-update REST/API flow.
  4. REST API endpoint filters (hivepress/v1/rest/listings/%d/update)
    • No effect—hooks aren’t triggered here.
  5. Client-side JS hook (listing:update:success)
    • I can detect success but clearing via JS isn’t ideal for data consistency.
  6. Form moderation (_moderated flag on form fields)
    • Applies only to certain fields and doesn’t reset the verified attribute itself.

Questions:

  1. Which server-side hook or filter is the correct one to catch every front-end listing update, so I can programmatically clear the “verified” attribute?
  2. Are there alternative recommended approaches—e.g. custom REST middleware, modifying the listing_update form schema, or another HivePress API—to enforce manual re-approval on edits?
  3. From a production standpoint (stability, upgrade-safety, multi-server scaling), what method does HivePress recommend for this workflow?

Thank you in advance for any pointers or code samples—my goal is to ensure no listing remains “verified” after an edit until an admin explicitly re-approves it.

Please check the _moderated attribute via the search feature.

1 Like

Hi,

Please try this code snippet:

add_action(
	'hivepress/v1/models/listing/update',
	function ( $listing_id, $listing ) {
		if ( hivepress()->helper->is_rest() && $listing->is_verified() ) {
			$listing->set_verified( false )->save_verified();
		}
	}, 1000, 2
);

It should remove the Verified status on any listing update made via REST API (including the front-end listing edit form). Please note that it may cover extra cases, if you have specific attributes marked as Moderated it may be better to use the hivepress/v1/models/listing/update_status hook to remove the Verified status when a new listing status is Pending (this occurs when any of moderated attribute values are changed).

Hope this helps

Hello,

I added the snippet you provided to my child theme’s functions.php , cleared all caches, and even reactivated the plugin. However, when I edit a listing on the front end, the verified attribute is still not being reset.

Could there be something wrong with my implementation or my environment? I’d appreciate any advice you can offer.

Thank you!

Please try this code snippet instead:

add_filter(
 'hivepress/v1/forms/listing_update/errors',
 function ( $errors, $form ) {
  if ( ! $errors ) {
   $listing = $form->get_model();
   if ( $listing ) {
    $listing->set_verified( false )->save_verified();
   }
  }
  return $errors;
 },
 1000,
 2
);

It should remove Verified status from listing when it’s updated via the front-end form.