I just worked on CSS, I did not even touch a line of code.
If I understand correctly, the lines of code that you are referring to are the following:
<?php
/**
* Plugin Name: Football Pool show number prediction and avatar
* Description: Show number of predictions in the ranking table and also the user avatar.
* Version: 1.0
* Author: Antoine Hurkmans
* Author URI: mailto:[email protected]
* License: MIT
*/
// Show number of predictions in the ranking table and also the user avatar.
// If you want the page, shortcode or widget to have different layouts,
// you can differentiate with the $type.
add_filter( ‘footballpool_ranking_template_start’,
function( $template_start, $league, $user, $ranking_id, $all_user_view, $type ) {
// add a row with column headers
$template_start .= sprintf( ‘<tr>
<th></th>
<th class=”user”>%s</th>
<th class=”num-predictions”>%s</th>
<th class=”score”>%s</th>
%s</tr>’
, __( ‘user’, ‘football-pool’ )
, __( ‘predictions’, ‘football-pool’ )
, __( ‘points’, ‘football-pool’ )
, ( $all_user_view ? ‘<th></th>’ : ” )
);
return $template_start;
}, null, 6 );
add_filter( ‘footballpool_ranking_ranking_row_template’, function( $template, $all_user_view, $type ) {
if ( $all_user_view ) {
$ranking_template = ‘<tr class=”%css_class%”>
<td style=”width:3em; text-align: right;”>%rank%.</td>
<td>%user_avatar%%user_name%</td>
<td class=”num-predictions”>%num_predictions%</td>
<td class=”ranking score”>%points%</td>
<td>%league_image%</td>
</tr>’;
} else {
$ranking_template = ‘<tr class=”%css_class%”>
<td style=”width:3em; text-align: right;”>%rank%.</td>
<td>%user_avatar%%user_name%</td>
<td class=”num-predictions”>%num_predictions%</td>
<td class=”ranking score”>%points%</td>
</tr>’;
}
return $ranking_template;
}, null, 3 );
?>