Delete listings by CPT

This topic contains 6 replies, has 3 voices, and was last updated by  Alex Howes 6 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #433660

    Alex Howes
    Expired Member
    Post count: 175

    Hello,

    I have two CPTS, farms and jobs. I want to discourage users from deleting farms, but allow them to delete jobs. Since I don’t think GD offers a way to do this, my plan is to remove the “delete” button from the CPTs using CSS, and then create a form that users can fill in if they want to delete a job.

    I’ve written a php snippet that hooks into the form submit action. Is there a GD function that I can use to delete a listing (or send it to trash) programmatically?

    Thanks,
    Alex

    #433727

    Alex Rollin
    Moderator
    Post count: 27815

    You can find all the functions documented here:

    https://wpgeodirectory.com/codex/codex_project/geodirectory_functions/page/33/

    It does not look like there is exactly a programmatic function for that, but I have flagged your question for the developers who will let us know

    https://www.google.co.uk/search?&q=site%3Awpgeodirectory.com+codex+delete

    Have you considered using the API?

    #433746

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You can set the deleted listings to go to trash only so u can empty jobs and save farms.

    Stiofan

    #434727

    Alex Howes
    Expired Member
    Post count: 175

    Hi Stiofan and Alex,

    I want to delete the listings programmatically rather than manually recover them from trash. I had a look through the CODEX documentation but couldn’t find anything relevant. Do you know how there might be a way?

    I’ve not yet used the API, Alex. Would there be a way to do it like that? Could you suggest how? I’m a bit reluctant to use the API though because I don’t want the endpoint pages to be public.

    Thanks,
    Alex

    #435175

    Alex Howes
    Expired Member
    Post count: 175

    Did anyone get a chance to look at this?

    Alex

    #435184

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    There is no settings to be able to do this, you would have to unhook our delete function and then hook your own in to then do what you want, but this is beyond support and would require customisation.

    You might find someone on here if you don’t have the dev skills yourself: https://geodirectoryexperts.com/

    Thanks,

    Stiofan

    #435261

    Alex Howes
    Expired Member
    Post count: 175

    Ok, fair enough, thanks anyway 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount