Is there a way to get grab a date that a post was edited? Even if it means a custom field that always gets filled with the current date would work for me. I don't want something the editor will have to worry about filling in, needs to be automatic.
Am I on the right track here?
The following would go in my kfunctions file:
- Code: Select all
class SetEditedDate{
function set_edited_date( $field ){
global $FUNCS;
// get publish date ..
$f = &$field->siblings[3];
$publish_date = trim( $f->get_data() );
$field->data = $publish_date;
$field->modified = 1;
unset( $f );
return true;
}
}
And then I would just add a validator on the field like this:
- Code: Select all
validator='SetEditedDate::set_edited_date'
And then just hide this field from the user in the admin panel using a message field with CSS in it.
I believe this should always get me the edited date then. Can anyone confirm I'm thinking this right?