Préparer les éléments
La configuration de base d’une extension est la même à chaque fois que vous créez une extension. Créez un sous-dossier dans le dossier wp-content/plugins, donnez-lui un nom. Pour l’exercice, appelez-le « my-gmap ».
À l’intérieur du dossier my-gmap, créez un fichier my-gmap.php. Insérez dans le dossier les fichiers readme.txt, licence.txt, index.php (vide), selon vos besoins.
En haut du fichier my-gmap.php, ajoutez un commentaire d’en-tête avec les informations sur l’extension et activez l’extension. Puis, vérifiez que l’extension apparaît bien dans l’administration.
Le commentaire est le suivant :
<?php
/*
Plugin Name: My Gmap
Description: Créer des cartes Google Maps.
Version: 1.0
License: GPLv2
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write...