wpseek.com
WordPress开发者和主题制作者的搜索引擎



update_recently_edited › WordPress Function

Since1.5.0
已弃用n/a
update_recently_edited ( $file )
参数:
  • (string) $file
    Required: Yes
定义在:
文档:

Updates the "recently-edited" file for the plugin or theme file editor.



源码

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 );
}