Add a custom button on each listing

Hi again,

I have some trouble with the edit of the listing, i simply want to desable the edit of the listing, becous it seams that the information before editing getting lost, so a use can change the information of the listing just before the sell.
So i would like to know if there is an easy way to block the user from editing his listing completly.
even with the moderator feedback before validating edit, the value still be change and i can’t see the original value befor editing so …

i tryed to use this snippet but it doesn’t work:

add_filter('hivepress/v1/forms/listing', 'disable_listing_edit', 10, 2);

function disable_listing_edit($form, $args) {
    $current_user_id = get_current_user_id();
    $listing_author_id = hp\get_user_id($args['listing_author']);

    if ($current_user_id === $listing_author_id) {
        $form = [];
    }

    return $form;
}

I realy need some help for this, because it can easly break all my website if it still like that…

Hi,

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 https://fvrr.co/32e7LvY

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