Support » Plugins » Hacks » How to Handle 'Journaling'

  • Resolved Michael

    (@mikeyhoward1977)


    This may be more of a request for advice than anything…

    I want to add a Journaling function into my plugin whereby all actions are logged. My initial thought was to use comments as it seemed to be the most logical solution and meets my requirements. However, I keep running into the duplicate comment error – Is there a way to bypass this filter? I am currently using wp_new_comment($data) to insert the comments but as many entries will be from the same author/email and related to the same post the duplication filter is getting in my way – I need to ensure no other plugins filter this either…

    Or is a better way to do this to create child posts? Or is there any other recommendations?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Tim Nash

    (@tnash)

    Spam hunter

    Given the timestamp of the action will be ever so slightly different to the comment, maybe it’s worth appending the timestamp within the comment data, thereby making it a unique comment, I know that’s very much a hack but might work?

    Alternatively I think you could manipulate wp_filter_comment to get round the duplication issue?

    Thread Starter Michael

    (@mikeyhoward1977)

    Yes it works… thank you

    Tim Nash

    (@tnash)

    Spam hunter

    out of interest which option did you go for?

    Thread Starter Michael

    (@mikeyhoward1977)

    I added the timestamp in brackets to the end of the content to make it unique. It works fine although I now have to filter the content I display as these comments will be visible to cumstomers and I don’t want the timestamp there – easy enough to do but would have been nice to avoid

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Handle 'Journaling'’ is closed to new replies.