Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom Post Type Activity Date_Recorded Sets to 0000-00-00 00:00:00


  • ndsailor
    Participant

    @ndsailor

    Hello:

    Searching for any help you all might be able to provide. When creating a custom post type from a front-end form (tested with both Gravity Forms and Buddyforms) the activity record for the new post has a date far into the past.

    I looked into the database to see what was being written and I discovered that the activity record -> date_recorded (wp_bp_activity => date_recorded ) is getting set to 0000-00-00 00:00:00 rather than the date the post was published.

    When I publish the CPT from the regular wp-admin, the activity date is recorded properly and shows up at the top of an activity feed.

    I realize this is a third-party integration, but I’d like to help the plugin authors sort this out as quickly as possible. And because it is showing up with two plugins, I thought I’d see if there were any ideas here as to what’s going on.

    Thanks in advance,
    JW

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

  • Henry Wright
    Moderator

    @henrywright

    wp_insert_post() takes an array as its first param. post_date is set to the current time by default so something is setting it to 0000-00-00 00:00:00.

    If you’re talking about BuddyPress activity items (not WordPress posts) then recorded_time also defaults to the current time. Again, in this case there must be something in your plugin that is setting it to 0000-00-00 00:00:00.

    Ref: https://codex.buddypress.org/developer/function-examples/bp_activity_add/


    Paul Gibbs
    Keymaster

    @djpaul

    @ndsailor It sounds like you’ve got some development skills, so I’d suggest starting with some backtracing or debug statements in wp_insert_post or the like, and follow it upwards. I think we’re going to struggle to even begin to offer any meaningful guesses this far removed from the overall code. 🙁


    r-a-y
    Keymaster

    @r-a-y

    I would check to see what GF and BF’s BuddyPress integration looks like.

    They might be calling bp_activity_add(). Do a search for that and see what parameters they are passing. In particular, check the recorded_time value and do a dump of that parameter and see if it is empty or not.


    ndsailor
    Participant

    @ndsailor

    Thanks Everyone!

    I went back to the tried and true deactivate-plugins-and-themes method and I did find a culprit. Edit Flow is causing the problem. I have let the plugin author know.

    Appreciate the help.
    JW

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar