Timeline for Get how many days since last post of the current user
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
|
|
Nov 22, 2013 at 13:08 | comment | added | gmazzap |
@ChristineCooper in that case, if the update is done by another user, using your suggestion last update can be, let's say, today, even if that user don't update a post since a long time. Maybe the last_update meta should be updated only if $p->post_author == get_current_user_id() . Code as is target "last time an user update a post (no matter the post author)". Your code target "Last time a post by a specific user was updated".
|
|
Nov 21, 2013 at 17:51 | comment | added | Christine Cooper♦ | I've been using this code as well but it has one problem. It updates the current_user's meta value, not the post-author's. So if an admin/editor publishes the post, the post-author, who had their post pending will not have their value updated. To fix this, on "update_user_meta()", simply replace "get_current_user_id()" with "$p->post_author". | |
Nov 12, 2013 at 17:58 | comment | added | Mark | You are a king. tested it and everything is in order! thank you so much!! | |
Nov 12, 2013 at 17:57 | vote | accept | Mark | ||
Nov 12, 2013 at 17:46 | history | edited | gmazzap | CC BY-SA 3.0 |
added 47 characters in body
|
Nov 12, 2013 at 17:29 | history | edited | gmazzap | CC BY-SA 3.0 |
added 47 characters in body
|
Nov 12, 2013 at 17:29 | comment | added | Mark | What type of drink do I need to share with you... for you to give me this magical function? ;) | |
Nov 12, 2013 at 17:23 | comment | added | Mark | Great!! Question, if I add this now to my site, it will only be in effect for users after they publish a new post? So all users will start blank? | |
Nov 12, 2013 at 17:17 | history | answered | gmazzap | CC BY-SA 3.0 |