WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Theme::get_files() WP 3.4.0

Return files in the theme's directory.

Это метод класса: WP_Theme

Хуков нет.


Строку[]. Array of files, keyed by the path to the file relative to the theme's directory, with the values being absolute paths.


$WP_Theme = new WP_Theme();
$var = $WP_Theme->get_files( $type, $depth, $search_parent );
Array of extensions to find, string of a single extension, or null for all extensions.
По умолчанию: null
How deep to search for files.
-1 depth is infinite.
По умолчанию: flat scan (0 depth)
Whether to return parent files.
По умолчанию: false

Список изменений

С версии 3.4.0 Введена.

Код WP Theme::get files: wp-includes/class-wp-theme.php WP 5.4.1

public function get_files( $type = null, $depth = 0, $search_parent = false ) {
	$files = (array) self::scandir( $this->get_stylesheet_directory(), $type, $depth );

	if ( $search_parent && $this->parent() ) {
		$files += (array) self::scandir( $this->get_template_directory(), $type, $depth );

	return $files;