$dirname =
pathinfo( $file, PATHINFO_DIRNAME
);
$file_path =
$allowed_files[ $file ];
if ( isset( $wp_file_descriptions[ basename( $file ) ] ) && '.' ===
$dirname ) { return $wp_file_descriptions[ basename( $file ) ];
} elseif ( file_exists( $file_path ) &&
is_file( $file_path ) ) { $template_data =
implode( '',
file( $file_path ) );
if ( preg_match( '|Template Name:(.*)$|mi',
$template_data,
$name ) ) { /* translators: %s: Template name. */
return sprintf( __( '%s Page Template'
),
_cleanup_header_comment( $name[1
] ) );
} } return trim( basename( $file ) );
}/**
* Gets the absolute filesystem path to the root of the WordPress installation.
*
* @since 1.5.0
*
* @return string Full filesystem path to the root of the WordPress installation.
*/