WordPress.org

Support

Support » Plugins and Hacks » [Resolved] add_post_meta vs. update_post_meta

[Resolved] add_post_meta vs. update_post_meta

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wayne Allen
    Participant

    @wayneallen-1

    Can you post the code?

    elforesto
    Member

    @elforesto

    Here’s the current code I’ve written: http://pastebin.com/9T7p5ABX

    The Geo My WP plugin is premium, so I don’t think I can share their code without breaking the license agreement. Internally, it runs a series of update_post_meta calls, then it executes its own query to drop location data into wp_places_locator. Neither of these seems to work when I call gmw_pt_update_location() within filterPostie.php, but I don’t get any PHP errors either. If the post ID is false when it runs, it gracefully exits.

    Plugin Author Wayne Allen
    Participant

    @wayneallen-1

    The issue is that the filter is called before the post is created so that a Postie AddOn has a chance to fiddle the data before the post is created.

    I’ve added a new filter in 1.5.14 “postie_post_after” which is called after the post is created.

    elforesto
    Member

    @elforesto

    It works perfectly now. Thanks! I’ve updated the code in the link above to reflect the final and working version. It also includes notes on version requirements. Feel free to use, reuse, and distribute as needed.

    Plugin Author Wayne Allen
    Participant

    @wayneallen-1

    Thanks! Glad to hear it is working.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] add_post_meta vs. update_post_meta’ is closed to new replies.