WP_Filesystem_Direct::owner( string $file ): string|false
- Since
- 2.5.0
- Source
wp-admin/includes/class-wp-filesystem-direct.php:229
Gets the file owner.
Parameters
$filestring- Path to the file.
Return
string|false- Username of the owner on success, false on failure.
Used by · 1
- WP_Filesystem_Direct::dirlist()Gets details for files in a directory or a specific file.
Source
public function owner( $file ) { $owneruid = @fileowner( $file ); if ( ! $owneruid ) { return false; } if ( ! function_exists( 'posix_getpwuid' ) ) { return $owneruid; } $ownerarray = posix_getpwuid( $owneruid ); if ( ! $ownerarray ) { return false; } return $ownerarray['name']; }History
Introduced in 2.5.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.1.0
Return type changed from
string|false to string|int<1,.verified against source2.5.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-admin/includes/class-wp-filesystem-direct.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.