Fragen\GitHub_Updater\Plugin::plugin_row_meta PHP Метод

plugin_row_meta() публичный Метод

Add 'View details' link to plugins page.
public plugin_row_meta ( $links, $file ) : array
$links
$file
Результат array $links
    public function plugin_row_meta($links, $file)
    {
        $regex_pattern = '/<a href="(.*)">(.*)<\\/a>/';
        $repo = dirname($file);
        $slugs = $this->get_repo_slugs($repo);
        $repo = !empty($slugs) ? $slugs['repo'] : null;
        /*
         * Sanity check for some commercial plugins.
         */
        if (!isset($links[2])) {
            return $links;
        }
        preg_match($regex_pattern, $links[2], $matches);
        /*
         * Remove 'Visit plugin site' link in favor or 'View details' link.
         */
        if (array_key_exists($repo, $this->config)) {
            if (!is_null($repo)) {
                unset($links[2]);
                $links[] = sprintf('<a href="%s" class="thickbox">%s</a>', esc_url(add_query_arg(array('tab' => 'plugin-information', 'plugin' => $repo, 'TB_iframe' => 'true', 'width' => 600, 'height' => 550), network_admin_url('plugin-install.php'))), esc_html__('View details', 'github-updater'));
            }
        }
        return $links;
    }