更新插件或主题编辑器的“最近编辑过的”文件。
原型
update_recently_edited( string $file )
参数
$file
(string)
(Required)
源文件
路径:wp-admin/includes/misc.php
<?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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/update_recently_edited/