reorganizing vocabulary alphabetically on front end render.php
This commit is contained in:
parent
098f583de3
commit
033257bae8
|
|
@ -1,7 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
$tooltipWords = $attributes['tooltipWords'];
|
$tooltipWords = $attributes['tooltipWords'];
|
||||||
|
|
||||||
|
// Fonction de comparaison pour usort
|
||||||
|
function compareTooltipText($a, $b)
|
||||||
|
{
|
||||||
|
return strcmp($a['tooltipText'], $b['tooltipText']);
|
||||||
|
}
|
||||||
|
// Utilisation de usort pour trier le tableau par ordre alphabétique
|
||||||
|
usort($tooltipWords, 'compareTooltipText');
|
||||||
|
|
||||||
|
|
||||||
global $post;
|
global $post;
|
||||||
$thematique = get_the_terms($post->ID, 'thematiques')[0];
|
$thematique = get_the_terms($post->ID, 'thematiques')[0];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section id="vocabulaire-summary" class="homegrade-blocks-vocabulaire-summary">
|
<section id="vocabulaire-summary" class="homegrade-blocks-vocabulaire-summary">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
$tooltipWords = $attributes['tooltipWords'];
|
$tooltipWords = $attributes['tooltipWords'];
|
||||||
|
|
||||||
|
// Fonction de comparaison pour usort
|
||||||
|
function compareTooltipText($a, $b)
|
||||||
|
{
|
||||||
|
return strcmp($a['tooltipText'], $b['tooltipText']);
|
||||||
|
}
|
||||||
|
// Utilisation de usort pour trier le tableau par ordre alphabétique
|
||||||
|
usort($tooltipWords, 'compareTooltipText');
|
||||||
|
|
||||||
|
|
||||||
global $post;
|
global $post;
|
||||||
$thematique = get_the_terms($post->ID, 'thematiques')[0];
|
$thematique = get_the_terms($post->ID, 'thematiques')[0];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section id="vocabulaire-summary" class="homegrade-blocks-vocabulaire-summary">
|
<section id="vocabulaire-summary" class="homegrade-blocks-vocabulaire-summary">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user