function tpicker_shortcode_version($atts) { include_once silverghyll_include_best_library('silverghyll-read-plugins.php'); $tpicker_options = get_option('taxonomy-picker-options'); $plugin = silverghyll_read_readme(TPICKER_DIR . 'readme.txt'); $version = $plugin['version']; return $version .= array_key_exists('premium-widget', $tpicker_options) ? ' (Premium)' : ''; }
function silverghyll_read_plugins($folder) { $folder = trailingslashit($folder); if (!is_dir($folder)) { return null; } // Cannot deal with something which is not a folder foreach (new DirectoryIterator($folder) as $file) { if (!$file->isDot() && $file->getFilename() != basename($_SERVER['PHP_SELF'])) { if ($file->isDir()) { $readme = $folder . $file->getFilename() . "/readme.txt"; if (file_exists($readme)) { $title = ''; $plugin_vars = silverghyll_read_readme($readme, $title); $installed_plugins[$title] = array(); foreach (array('author', 'author uri', 'contributors', 'contributors uri', 'plugin name', 'plugin uri', 'tags', 'title', 'version') as $item) { $installed_plugins[$title][$item] = $plugin_vars[$item]; } } } } } return $installed_plugins; }