WP_Filesystem_Direct::is_readable() WordPress Method
The WP_Filesystem_Direct::is_readable() method is a quick and easy way to check if a file is readable by the current user. This is useful for checking if a user has permission to read a file before attempting to read it.
WP_Filesystem_Direct::is_readable( string $file ) #
Checks if a file is readable.
Parameters
- $file
(string)(Required)Path to file.
Return
(bool) Whether $file is readable.
Source
File: wp-admin/includes/class-wp-filesystem-direct.php
public function is_readable( $file ) { return @is_readable( $file ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |