Home › Forums › Front-end Issues › Front End Form -> the_modified_time() › Reply To: Front End Form -> the_modified_time()
Hey thanks for replying man.
The function essentially does do nothing other than update the post object.
So instead of creating a function that updates the modified time row in the database, I’m using wp_post_update() to simply update the post object so wordpress stamps the new time.
So if I call this function on page load
function update_time() {
$my_post = array();
$my_post['ID'] = 1674; //or $post->ID in the loop
wp_update_post( $my_post );
}
update_time();
the function runs and updates the post specified (in this case post id 1674) and wordpress updates the last modified time of the post.
http://codex.wordpress.org/Function_Reference/wp_update_post they show an example of attaching this to save_post, which is basically what I’m trying to do.
I’ll just manually make the form since I’m only updating 2 meta values (and both of them are pre-populated select boxes lol).
I’ll mark it as solved but it would be interesting to know if its possible to do this.
thanks again
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.