get_file_data


get_file_data ( $file, $default_headers, $context = '' )

Parameters:
  • (string) $file Absolute path to the file.
  • (array) $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`.
  • (string) $context Optional. If specified adds filter hook {@see 'extra_$context_headers'}. Default empty.
Links:
Returns:
  • (array) Array of file headers in `HeaderKey => Header Value` format.
Defined at:

Description

Retrieve metadata from a file.

Searches for metadata in the first 8 KB of a file, such as a plugin or theme. Each piece of metadata must be on its own line. Fields can not span multiple lines, the value will get cut at the end of the first line.

If the file data is not within that first 8 KB, then the author should correct their plugin file and move the data headers to the top.

Related Functions

get_inline_data, wp_get_pomo_file_data, get_theme_data, get_the_date, get_userdata

Top Google Results

User discussions

wpseek mobile