• Resolved dueckjon

    (@dueckjon)


    Hi there, I have been using the following code to add an icon to recently updated posts.

    <?php
        $mylimit=3 * 86400; //days * seconds per day
         $post_age = date('U') - get_the_modified_time('U');
        if ($post_age < $mylimit) {
            echo '<span class="menu-icon-update">';
            echo '</span>';
        }
    ?>

    Is there any way to get the date that a specific field has been updated? For example if a new file had been added to a field, it might be nice to highlight that change. I’m not sure if that’s possible, but I thought I would ask.

    https://wordpress.org/plugins/ultimate-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Radoslav Georgiev

    (@radogeorgiev)

    Hi Jon,
    sorry for the “fast” reply.

    It’s possible, but it would include some implications and I really wouldn’t suggest anything straight away, because the implementation is quite case-specific.

    Overall the problem comes from the fact that every time you save a post, all of the fields about it get overwritten/updated even if there is no change in the content. The trick would be to always save the old value too and compare it to the new one, but again – it’s highly case-specific 🙂

    Thread Starter dueckjon

    (@dueckjon)

    Hi Radoslav. Thanks for the response. I had figured that this wasn’t possible, but I thought I would check. Thanks for letting me know!

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

The topic ‘Get Field Update Date’ is closed to new replies.