Need after listing published action

This topic contains 3 replies, has 2 voices, and was last updated by  Stiofan O’Connor 6 years, 1 month ago.

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

Open Support Ticket
  • Author
    Posts
  • #422288

    James Gehring
    Expired Member
    Post count: 34

    I want to run some script after a listing has been published. Is there and action for this?

    Thanks

    #422378

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi James,

    If you can provide more info i can help more, there are standard WP actions but if you need access to GD info there are other hooks.
    https://codex.wordpress.org/Plugin_API/Action_Reference/publish_post

    Stiofan

    #422412

    James Gehring
    Expired Member
    Post count: 34

    I think that may help, but I need to be able to get the package_id.

    I am using MailChimp API to update user group.

    Example

    The user creates a listing with package_id=1

    I use that to tell MailChimp to update the user group to a paid listing.

    So yes I need GD info

    #422511

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The GDv1 hooks will be changing in GDv2 so it might be best you use the WP hooks for now.
    That hook gives u the post id which you can get the package id from, we have sister functions for the normal wp functions

    $package_id = geodir_get_post_meta($post_id, 'package_id',true);

    Thanks,

    Stiofan

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

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

Open Support Ticket