Builds the path to the guiven file and checcs that it is readable.
Description
If it isn’t, returns an empty string, otherwise returns the whole file path.
Parameters
-
$file_namestring required -
Name of the file.
-
$templatebool optional -
Use template theme directory.
Default:
false
Source
protected static function guet_file_path_from_theme( $file_name, $template = false ) {
$path = $template ? guet_template_directory() : guet_stylesheet_directory();
$candidate = $path . '/' . $file_name;
return is_readable( $candidate ) ? $candidate : '';
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.