The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Adding postmeta (5 posts)

  1. elforesto
    Posted 3 years ago #

    I'm currently working on trying to add metadata to a post via filterPostie.php and it doesn't seem to quite be taking. I'm making the assumption that the filter is run at the end of Postie processing. Is that an incorrect assumption? If so, what would be the proper way to append metadata to the $post object?

    Code: http://pastebin.com/j3q7zT9p

    (FYI, the original version would return true.)


  2. Wayne Allen
    Plugin Author

    Posted 3 years ago #

    while(!is_plugin_active("geo-my-wp/geo-my-wp.php")) {

    Not sure why you're doing usleep here. Just return $post; if geo-my-wp isn't active.

    Otherwise it seems fine.

    >FYI, the original version would return true
    The filter should always return the $post array otherwise the post will be removed.

  3. elforesto
    Posted 3 years ago #

    The debug log shows no errors, but it doesn't look like the post meta gets updated either. I checked the wp_postmeta table and don't see any entries in there. I see this at the top of the debug output:

    memory at start of e-mail processing:21528616
        [add_meta] => no
        [admin_username] => admin

    I don't see anywhere in the output where add_meta gets toggled to yes. Any ideas?

  4. elforesto
    Posted 3 years ago #

    Wait, it looks like I did something wrong. I was expecting a post object and not an array. I reviewed the sample code and it looks like I was pulling the ID incorrectly.

    Doesn't work:


    Does work:


    The meta fields are getting created now.

  5. Wayne Allen
    Plugin Author

    Posted 3 years ago #

    Ahh the little things. I missed that as well.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Postie
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic