Ciao, scusate una domanda ma vedendo un po di esempi e widget reali ho notato che molto spesso gli autori scrivono i dati dei widget sia sotto forma di commento all’inizio del codice, sia nel costruttore della classe.
Cioè, tanto per capirsi meglio, scrivono una cosa simile:
/*
Plugin Name: Pinco Pallino
Description: Il widget di Pinco Pallino.
[...]
*/
class Pinco_Pallino extends WP_Widget {
function Pinco_Pallino() {
$widget_ops = array('description' => 'Il widget di Pinco Pallino.' );
parent::WP_Widget(false, $name = 'Pinco Pallino', $widget_ops);
[...]
}
[...]
}
Scusate per l’identazione, quando ho aggiunto il codice e messo sotto i tag code non me l’ha indentato e non sapevo come rimediare a mano.
So che WP si va a leggere il commento iniziale per estrapolare le informazioni sul plug-in, ma c’è un motivo per cui questi dati vengono passati due volte ?
Grazie