On this page
update_recently_edited( string $file )
Updates the “recently-edited” file for the plugin or theme file editor.
Parameters
$filestring Required
Source
File: wp-admin/includes/misc.php. View all references
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 );
}
Related
Uses
| Uses | Description |
|---|---|
| update_option() wp-includes/option.php | Updates the value of an option that was already added. |
| get_option() wp-includes/option.php | Retrieves an option value based on an option name. |
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_recently_edited