Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_file_data()

3 tags 1 category

get_file_data() — Retrieves 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.

Inputs: $file (string): Absolute path to the file. $default_headers (array): List of headers, in the format array( ‘HeaderKey’ => ‘Header Name’ ). $context (string): Optional. If specified adds filter hook ‘extra_$context_headers’. Default empty string.

Returns string[]: Array of file header values keyed by header name.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…