/** * @access public * * @param string $file * @return bool */ public function is_file($file) { if ($this->authorized()) { return parent::is_file($file); } else { return false; } }
function dt_exctract_icon($file = "", $pref = "") { $wp_filesystem = new WP_Filesystem_Direct(array()); if (!$wp_filesystem->is_file($file) || !$wp_filesystem->exists($file)) { return false; } if ($buffers = $wp_filesystem->get_contents_array($file)) { $icons = array(); foreach ($buffers as $line => $buffer) { if (preg_match("/^(\\." . $pref . ")([^:\\]\"].*?):before/i", $buffer, $out)) { if ($out[2] !== "") { $icons[$pref . $out[2]] = $pref . $out[2]; } } } return $icons; } else { return false; } }