WordPress at Your Fingertips
function is not described

WP_Filesystem_Direct::get_contents() public WP 2.5.0

Reads entire file into a string.

{} It's a method of the class: WP_Filesystem_Direct{}

No Hooks.

Return

String|false. Read data on success, false on failure.

Usage

$WP_Filesystem_Direct = new WP_Filesystem_Direct();
$WP_Filesystem_Direct->get_contents( $file );
$file(string) (required)
Name of the file to read.

Changelog

Since 2.5.0 Introduced.

Code of WP_Filesystem_Direct::get_contents() WP 5.8.2

public function get_contents( $file ) {
	return @file_get_contents( $file );
}