Remove add listing button, when one listing is created

is it possible to remove the ‘Add Listing’ button once the vendor has created their first listing? I want each vendor to have only one listing. Perhaps there’s a PHP snippet to hide the function altogether for vendors who already have a listing .


Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work

I’ve found a solution:

    function( $value ) {
        if ( ! is_admin() && ! current_user_can( 'edit_posts' ) ) {
            return false;

        // listing already done?
        $user_id = get_current_user_id(); // Benutzer-ID abrufen
        $listing_count = \HivePress\Models\Listing::query()->filter(
                'status__in' => [ 'publish', 'pending', 'draft' ],
                'user'       => $user_id,

        if ( $listing_count >= 1 ) {
            return false; // do not display button

        return $value;

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.