private function display_ghu_repos($type)
{
$plugins = Plugin::instance()->get_plugin_configs();
$themes = Theme::instance()->get_theme_configs();
$repos = array_merge($plugins, $themes);
$type_repos = array_filter($repos, function ($e) use($type) {
return false !== stristr($e->type, $type);
});
$display_data = array_map(function ($e) {
return $e = array('type' => $e->type, 'repo' => $e->repo, 'name' => $e->name, 'private' => isset($e->is_private) ? $e->is_private : false);
}, $type_repos);
$lock = ' <span class="dashicons dashicons-lock"></span>';
printf('<h2>' . esc_html__('Installed Plugins and Themes', 'github-updater') . '</h2>');
foreach ($display_data as $data) {
$dashicon = '<span class="dashicons dashicons-admin-plugins"></span> ';
$is_private = $data['private'] ? $lock : null;
if (false !== strpos($data['type'], 'theme')) {
$dashicon = '<span class="dashicons dashicons-admin-appearance"></span> ';
}
printf('<p>' . $dashicon . $data['name'] . $is_private . '</p>');
}
}