get_file

The WordPress Core get file function.

Description

get_file( $path ); 

Parameters (1)

0. $path
The path.

Usage

  1. if ( !function_exists( 'get_file' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/noop.php'; 
  3.  
  4. // The path. 
  5. $path = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_file($path); 
  9.  

Defined (2)

The function is defined in the following location(s).

/wp-admin/includes/noop.php  
  1. function get_file( $path ) { 
  2.  
  3. if ( function_exists('realpath') ) { 
  4. $path = realpath( $path ); 
  5.  
  6. if ( ! $path || ! @is_file( $path ) ) { 
  7. return ''; 
  8.  
  9. return @file_get_contents( $path ); 
/wp-includes/js/tinymce/wp-tinymce.php  
  1. function get_file($path) { 
  2.  
  3. if ( function_exists('realpath') ) 
  4. $path = realpath($path); 
  5.  
  6. if ( ! $path || ! @is_file($path) ) 
  7. return false; 
  8.  
  9. return @file_get_contents($path);