" : ' '); $located .= $rel_path; }elseif(strpos($path, $template_path) !== false){ $rel_path = str_replace($template_path, '', $path); if($prefix){ $located .= ($file_exists ? $prefix_label[0] : $prefix_label[1]) . ' '; } $located .= __('in theme:', 'acfe') . ($new_line ? "
" : ' '); $located .= $rel_path; }elseif(strpos($path, $wp_plugin_dir) !== false){ $rel_path = str_replace($wp_plugin_dir, '', $path); if($prefix){ $located .= ($file_exists ? $prefix_label[0] : $prefix_label[1]) . ' '; } $located .= __('in plugin:', 'acfe') . ($new_line ? "
" : ' '); $located .= $rel_path; }else{ $rel_file = str_replace($abspath, '', $path); if($prefix){ $located .= ($file_exists ? $prefix_label[0] : $prefix_label[1]) . ' '; } $located .= __('in:', 'acfe') . ($new_line ? "
" : ' '); $located .= $rel_file; } return $located; } /** * acfe_get_file_extension * * @param $file * * @return array|string */ function acfe_get_file_extension($file){ // extract the path component $path = parse_url($file, PHP_URL_PATH); // get the extension of the file return pathinfo($path, PATHINFO_EXTENSION); }