Aller au contenu principal
Version: 0.6.3

Theme

Représente le thème actif afin de pouvoir récupérer facilement des informations et y ajouter des comportements.

Cette façade est notamment utilisé dans le fichier principale du thème pour définir un updater.

themes/my-theme/functions.php
global $kernel;
$theme = $kernel->getTheme();
$theme
    ->defineUpdater(new Gitlab(
        repo: 'chemin/du/repo',
        accessToken: "mon_access_token", // Si le projet est privée
        url: "https://selfhosted.gitlab.com" // Si votre gitlab est auto hébergé.
    ));

Méthodes

onActivation(callable $callback)

Execute du code après l'activation du thème.

onDeactivation(callable $callback)

Execute du code après la désactivation du thème.

onCompletedUpdate(callable $callback)

Execute du code après la mise à jour du thème.

defineUpdater(GitInferface $git)

Défini un updater pour le thème. Pour le moment, uniquement Gitlab existe.