update_recently_edited() WordPress Function
The update_recently_edited() function is used to update the list of recently edited pages. This function is generally called when a page is edited, but can also be called explicitly.
update_recently_edited( string $file ) #
Updates the “recently-edited” file for the plugin or theme file editor.
Parameters
- $file
(string)(Required)
Source
File: wp-admin/includes/misc.php
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 );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |