Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get the icon image from the WordPress Plugin API
$bp_filetypes = array('128x128.png','128x128.jpg','256x256.png','256x256.jpg','logo.svg');
foreach ($bp_filetypes as $bp_filetype) {
$logo_item = $bp_filetype;
$url = '' . $pb_plugin_item[plugin_slug] . '/assets/icon-' . $logo_item;
//echo $url;
$exists = (@$fp = fopen($url, "r")) !== FALSE; if ($fp) fclose($fp);
if ($exists==true) { echo " true";
$logo = $bp_filetype;
//echo '<img src="' . $pb_plugin_item[plugin_slug] . '/assets/icon-'.$logo.'" style="height:50px; width:50px;">';
} elseif ($exists==false) { $logo = 'no'; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.