Summery Summery

Return files in the theme’s directory.

Syntax Syntax

WP_Theme::get_files( string[]|string $type = null, int $depth, bool $search_parent = false )

Parameters Parameters


(Optional) Array of extensions to find, string of a single extension, or null for all extensions.

Default value: null


(Optional) How deep to search for files. Defaults to a flat scan (0 depth). -1 depth is infinite.


(Optional) Whether to return parent files.

Default value: false

Return Return

(string[]) Array of files, keyed by the path to the file relative to the theme's directory, with the values being absolute paths.

Source Source

File: wp-includes/class-wp-theme.php


		return $files;

	 * Returns the theme's post templates.
	 * @since 4.7.0


Changelog Changelog

Version Description
3.4.0 Introduced.


Leave a Reply