/** * The function `wp_mkdir_p` will create directories recursively * * @param string $absolute_path * * @return string|bool absolute path or false if we can't have a writable and readable directory */ private function maybe_create_directory($absolute_path) { $result = true; if (!$this->filesystem->is_dir($absolute_path)) { $result = wp_mkdir_p($absolute_path); } if (!$this->filesystem->is_writable($absolute_path) || !$this->filesystem->is_readable($absolute_path)) { $result = $this->filesystem->chmod($absolute_path, 0755, true); } return $result ? $absolute_path : false; }
/** * @access public * * @param string $file * @return bool */ public function is_writable($file) { if ($this->authorized()) { return parent::is_writable($file); } else { return false; } }