Forum Replies Created

Viewing 16 replies (of 16 total)
  • Thread Starter nibu

    (@nibu)

    Hello Tobias !

    Thank you so much for your help !

    If i can, i prefer to speak french because I’m very bad in English ??

    J’ai essayé la procédure que tu m’as envoyée, mais hélas, je n’obtiens pas le résultat espéré.

    J’ai créé l’extension “WP-Table Reloaded Extensions” que j’ai modifiée en indiquant l’id de mon tableau et en modifiant le format de la date, soit d.m.y

    Dans la page ou j’ai inséré le code pour afficher le tableau, je n’obtiens aucun résultat à l’écran.

    Voici l’extension modifiée avec mes paramètres :

    <?php
    /*
    Plugin Name: WP-Table Reloaded Extensions
    Plugin URI: https://tobias.baethge.com/wordpress-plugins/wp-table-reloaded-english/extensions/
    Description: Custom Extensions for WP-Table Reloaded
    Version: 1.0
    Author: YOU, Tobias Baethge

    /**
    * Show only rows that have the current date in a cell
    */
    function wp_table_reloaded_filter_rows( $output_options, $table_id, $table ) {
    if ( 6 != $table_id )
    return $output_options;

    $filter = date( ‘d/m/Y’ );

    $row_match = false;
    foreach ( $table[‘data’] as $row_idx => $row ) {
    if ( 0 == $row_idx && $output_options[‘first_row_th’] )
    continue;

    if ( in_array( $filter, $row ) )
    $row_match = true;
    else
    $output_options[‘hide_rows’][] = (string)$row_idx;
    }

    // if search term(s) was/were not found in any of the rows, all rows need to be hidden
    if ( ! $row_match && $output_options[‘first_row_th’] )
    $output_options[‘hide_rows’][] = ‘0’;

    return $output_options;
    }

    // Register necessary Plugin Filter
    add_filter( ‘wp_table_reloaded_frontend_output_options’, ‘wp_table_reloaded_filter_rows’, 10, 3 );

    Dans mon tableau, j’ai pourtant bien un élève qui fête son anniversaire aujourd’hui mais rien ne s’affiche. En fait, il faudrait ne pas tenir compte de l’année, mais seulement du jour et du mois.

    Bonne soirée à toi,

    Bruno

Viewing 16 replies (of 16 total)