WP_Theme::scandir

Private AccessPrivate Access

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

SummerySummery

Scans a directory for files of a certain extension.

Syntax

WP_Theme::scandir( string $path, array|string|null $extensions = null, int $depth, string $relative_path = '' )

ParametersParameters

$path

(string) (Required) Absolute path to search.

$extensions

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

Default value: null

$depth

(int) (Optional) How many levels deep to search for files. Accepts 0, 1+, or -1 (infinite depth). Default 0.

$relative_path

(string) (Optional) The basename of the absolute path. Used to control the returned path for the found files, particularly when this function recurses to lower depths.

Default value: ''

ReturnReturn

(string[]|false) Array of files, keyed by the path to the file relative to the $path directory prepended with $relative_path, with the values being absolute paths. False otherwise.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
3.4.0 Introduced.
Scroll to Top