Esempio n. 1
0
function wl_leaderboard($attributes)
{
    global $post;
    if (!isset($attributes['year'])) {
        return "<strong>Erreur lors du chargement de la leaderboard</strong> : champs 'year' manquant.";
    }
    if (!isset($attributes['month'])) {
        return "<strong>Erreur lors du chargement de la leaderboard</strong> : champs 'month' manquant.";
    }
    $year = $attributes['year'];
    $month = $attributes['month'];
    if (isset($attributes['number'])) {
        $leaderboard = WL_Leaderboard::monthly($post->post_name, $year, $month, $attributes['number']);
    } else {
        $leaderboard = WL_Leaderboard::monthly($post->post_name, $year, $month);
    }
    return (string) $leaderboard;
}