Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| webdev:wordpress:ajouter_colonne_bo [26/04/2017 18:12] – dolo | webdev:wordpress:ajouter_colonne_bo [27/04/2017 14:23] (Version actuelle) – dolo | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Ajouter des colonnes en Back-office ====== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | **Pour un plugin :** | ||
| + | < | ||
| + | public function setTerrainAdminColumn($columns) | ||
| + | { | ||
| + | $columns = array_slice($columns, | ||
| + | return $columns; | ||
| + | } | ||
| + | |||
| + | public function addTerrainAdminColumn($column_name, | ||
| + | { | ||
| + | if($column_name == ' | ||
| + | { | ||
| + | $etat = get_post_meta($post_id, | ||
| + | if($etat == ' | ||
| + | { | ||
| + | echo ' | ||
| + | } | ||
| + | else if($etat == ' | ||
| + | { | ||
| + | echo ' | ||
| + | } | ||
| + | unset($etat); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | add_filter(' | ||
| + | add_action(' | ||
| + | </ | ||