Skip to content

Instantly share code, notes, and snippets.

@AndreaBarghigiani
Created June 21, 2018 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreaBarghigiani/b2cf08303e0a3bb275db5ea0f551c792 to your computer and use it in GitHub Desktop.
Save AndreaBarghigiani/b2cf08303e0a3bb275db5ea0f551c792 to your computer and use it in GitHub Desktop.
Codice di esempio per la creazione di una widget WordPress utilizzato nella pagina di definizione del termine API: https://skillsandmore.org/glossario/api/
<?php // Inserito soltanto per la colorazione della sintassi
class SAM_Widget extends WP_Widget{
public function __construct(){
// Cosa impostare durante l'inizializzazione della widget
}
public function widget(){
// Mostra il contenuto della widget
}
public function form(){
// Mostra il modulo delle opzioni nella bacheca
}
public function update( $new_instance, $old_instance ){
// Gestisce il salvataggio delle opzioni
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment