WP recently_edited option can be very useful – it tracks last 5 files that you’ve made changes to. Only problem is – well, that’s all, 5 files.

What if I’ve been made numerous changes to WordPress theme files by using default WP admin editor?

It would be helpfull if I had list of, say last 20 files edited and time when that happened.

Do anyone know where is stored function or some else mechanism that allow only 5 item to reside into array of recently_edited WP option?

I’ve tried with wp-admin/includes/schema.php and wp-includes/option.php where it, as I tohught, should be – no results.

2 Answers
2

The function is update_recently_edited in wp-admin/includes/misc.php. unfortunately it is fixed at 5:

function update_recently_edited( $file ) {
    $oldfiles = (array) get_option( 'recently_edited' );
    if ( $oldfiles ) {
        $oldfiles = array_reverse( $oldfiles );
        $oldfiles[] = $file;
        $oldfiles = array_reverse( $oldfiles );
        $oldfiles = array_unique( $oldfiles );
        if ( 5 < count( $oldfiles ))
            array_pop( $oldfiles );
    } else {
        $oldfiles[] = $file;
    }
    update_option( 'recently_edited', $oldfiles );
}

Leave a Reply

Your email address will not be published. Required fields are marked *