get_file() WordPress Function

The get_file() function is used to retrieve a filename from a WordPress installation. It takes two parameters: the first is the name of the file to be retrieved, and the second is the path to the file. The function returns the path to the file if it is found, or an empty string if the file is not found.

get_file( $path ) #

Contents


Source

File: wp-admin/includes/noop.php

function get_file( $path ) {

	$path = realpath( $path );

	if ( ! $path || ! @is_file( $path ) ) {
		return '';
	}

	return @file_get_contents( $path );
}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.