Fragen\GitHub_Updater\Install::install_theme_complete_actions PHP Метод

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

Fix activation links after theme installation, no method to get proper theme name.
public install_theme_complete_actions ( $install_actions, $api, $theme_info ) : mixed
$install_actions
$api
$theme_info
Результат mixed
    public function install_theme_complete_actions($install_actions, $api, $theme_info)
    {
        if (isset($install_actions['preview'])) {
            unset($install_actions['preview']);
        }
        $stylesheet = self::$install['repo'];
        $activate_link = add_query_arg(array('action' => 'activate', 'stylesheet' => urlencode($stylesheet)), admin_url('themes.php'));
        $activate_link = esc_url(wp_nonce_url($activate_link, 'switch-theme_' . $stylesheet));
        $install_actions['activate'] = '<a href="' . $activate_link . '" class="activatelink"><span aria-hidden="true">' . esc_attr__('Activate', 'github-updater') . '</span><span class="screen-reader-text">' . esc_attr__('Activate', 'github-updater') . ' &#8220;' . $stylesheet . '&#8221;</span></a>';
        if (is_network_admin() && current_user_can('manage_network_themes')) {
            $network_activate_link = add_query_arg(array('action' => 'enable', 'theme' => urlencode($stylesheet)), network_admin_url('themes.php'));
            $network_activate_link = esc_url(wp_nonce_url($network_activate_link, 'enable-theme_' . $stylesheet));
            $install_actions['network_enable'] = '<a href="' . $network_activate_link . '" target="_parent">' . esc_attr_x('Network Enable', 'This refers to a network activation in a multisite installation', 'github-updater') . '</a>';
            unset($install_actions['activate']);
        }
        ksort($install_actions);
        return $install_actions;
    }